FloweyTheFlower

Roblox Scripts #77 Laser Gun (edit)

Feb 9th, 2018
1,316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.82 KB | None | 0 0
  1.  
  2. Bonniee = Instance.new("ForceField", game.Players.LocalPlayer.Character)
  3. Bonniee.Visible = false
  4. local nel = game.Players.LocalPlayer.Character.Humanoid
  5. nel.MaxHealth = math.huge
  6. warn'Edit by Shi-Shi#4817'
  7. local Neo=string.reverse"3836#sleN yB "
  8. local plr = game.Players.LocalPlayer
  9. local char = plr.Character
  10. local mouse = plr:GetMouse()
  11. local torso = char.Torso
  12. local rs = torso["Right Shoulder"]
  13. local ls = torso["Left Shoulder"]
  14. local rh = torso["Right Hip"]
  15. local lh = torso["Left Hip"]
  16. local rj = char.HumanoidRootPart.RootJoint
  17. local neck = torso.Neck
  18. local animpose = "Idle"
  19. local attacking = false
  20. local cananim = true
  21. local rage = false
  22. local shield
  23. local sprint = false
  24. local canrage = true
  25. local legs = true
  26. local bc = char:WaitForChild("Body Colors")
  27. local multiplier = 1
  28. local lac = char["Body Colors"].LeftArmColor
  29. local rac = char["Body Colors"].RightArmColor
  30. local rlc = char["Body Colors"].RightArmColor
  31. local llc = char["Body Colors"].LeftLegColor
  32. local hc = char["Body Colors"].HeadColor
  33. local tc = char["Body Colors"].TorsoColor
  34. local humanoid = char:FindFirstChildOfClass("Humanoid")
  35. local huge = Vector3.new(math.huge, math.huge, math.huge)
  36. local e = Instance.new("Sound", char["Torso"])
  37. e.SoundId = "rbxassetid://318352064"
  38. e.Looped = true
  39. e.Volume = 10
  40. humanoid.MaxHealth = math.huge
  41. wait()
  42. humanoid.Health = math.huge
  43. e:Play()
  44. if char:FindFirstChild("Animate") then
  45.   char.Animate:Destroy()
  46. end
  47. if char:FindFirstChildOfClass("Humanoid"):FindFirstChild("Animator") then
  48.   char:FindFirstChildOfClass("Humanoid").Animator:Destroy()
  49. end
  50. function legsonly()
  51.   spawn(function()
  52.     for i = 0, 10 do
  53.       wait(0.001)
  54.       if attacking then
  55.         break
  56.       end
  57.     end
  58.     if not attacking then
  59.       legs = false
  60.     end
  61.   end)
  62. end
  63. function swait(t)
  64.   if t == nil or t == 0 then
  65.     game:service("RunService").Stepped:wait(0)
  66.   else
  67.     for i = 0, t do
  68.       game:service("RunService").Stepped:wait(0)
  69.     end
  70.   end
  71. end
  72. function KICK(PLAYER)
  73.   spawn(function()
  74.     local function SKICK()
  75.       if PLAYER.Character and PLAYER.Character:FindFirstChild("HumanoidRootPart") and PLAYER.Character:FindFirstChild("Torso") then
  76.         PLAYER.Character.HumanoidRootPart.CFrame = CFrame.new(math.random(999000, 1001000), 1000000, 1000000)
  77.         do
  78.           local SP = Instance.new("SkateboardPlatform", PLAYER.Character)
  79.           SP.Position = PLAYER.Character.HumanoidRootPart.Position
  80.           SP.Transparency = 1
  81.           spawn(function()
  82.             repeat
  83.               swait()
  84.               if PLAYER.Character and PLAYER.Character:FindFirstChild("HumanoidRootPart") then
  85.                 SP.Position = PLAYER.Character.HumanoidRootPart.Position
  86.               end
  87.             until not game:GetService("Players"):FindFirstChild(PLAYER.Name)
  88.           end)
  89.           PLAYER.Character.Torso.Anchored = true
  90.         end
  91.       end
  92.     end
  93.     spawn(function()
  94.       repeat
  95.         wait()
  96.         if PLAYER ~= nil then
  97.           SKICK()
  98.         end
  99.       until not game:GetService("Players"):FindFirstChild(PLAYER.Name)
  100.       if not game:GetService("Players"):FindFirstChild(PLAYER.Name) then
  101.         print("REMOVED " .. PLAYER.Name)
  102.       end
  103.     end)
  104.   end)
  105. end
  106. function hurt(hit, dmg)
  107.   if hit.Parent then
  108.     if hit.Parent:IsA("LocalScript") then
  109.       print("bocks!11")
  110.       hit.Parent:Destroy()
  111.     end
  112.     local hum = hit.Parent:FindFirstChildOfClass("Humanoid")
  113.     if hum and hum.Parent.Name ~= plr.Name then
  114.       if dmg == "Kill" or hum.Health > 100000 then
  115.         hit.Parent:BreakJoints()
  116.         return true
  117.       else
  118.         if math.random(0, 100) == 50 then
  119.           hum.Health = hum.Health - dmg * multiplier * 2.5
  120.         else
  121.           hum.Health = hum.Health - dmg * multiplier
  122.         end
  123.         return true
  124.       end
  125.     end
  126.   end
  127. end
  128. function soundeffect(id, volume, speed, parent)
  129.   spawn(function()
  130.     local s = Instance.new("Sound")
  131.     s.SoundId = id
  132.     s.Volume = volume
  133.     s.PlaybackSpeed = speed
  134.     s.Parent = parent
  135.     s:Play()
  136.     repeat
  137.       wait()
  138.     until not s.Playing
  139.     s:Destroy()
  140.   end)
  141. end
  142. function gethum(obj)
  143.   if obj.Parent and obj.Parent:FindFirstChild("Humanoid") and obj.Parent.Name ~= plr.Name then
  144.     return obj.Parent:FindFirstChildOfClass("Humanoid")
  145.   end
  146. end
  147. function smooth(obj)
  148.   local sides = {
  149.     "Left",
  150.     "Right",
  151.     "Top",
  152.     "Bottom",
  153.     "Front",
  154.     "Back"
  155.   }
  156.   for i, v in pairs(sides) do
  157.     obj[v .. "Surface"] = "SmoothNoOutlines"
  158.   end
  159. end
  160. function fade(obj, dest, grow)
  161.   spawn(function()
  162.     local oldcf = obj.CFrame
  163.     for i = 0, 10 do
  164.       if grow then
  165.         obj.Size = obj.Size + Vector3.new(1, 1, 1)
  166.         obj.CFrame = oldcf
  167.       end
  168.       obj.Transparency = obj.Transparency + 0.1
  169.       swait()
  170.     end
  171.     if dest then
  172.       obj:Destroy()
  173.     end
  174.   end)
  175. end
  176. local keyamount = 0
  177. mouse.KeyDown:connect(function(key)
  178.   if key == "w" or key == "a" or key == "s" or key == "d" then
  179.     keyamount = keyamount + 1
  180.     if animpose ~= "Falling" then
  181.       if keyamount > 3 then
  182.         keyamount = 0
  183.       end
  184.       animpose = "Walking"
  185.     end
  186.   end
  187. end)
  188. mouse.KeyUp:connect(function(key)
  189.   if key == "w" or key == "a" or key == "s" or key == "d" then
  190.     keyamount = keyamount - 1
  191.     if keyamount < 0 then
  192.       keyamount = 0
  193.     end
  194.     if keyamount == 0 then
  195.       animpose = "Idle"
  196.     end
  197.   end
  198. end)
  199. local gun = Instance.new("Part")
  200. gun.Size = Vector3.new(.1, .1, .1)
  201. gun.CanCollide = true
  202. local m = Instance.new("SpecialMesh", gun)
  203. m.MeshId = "rbxassetid://468351345"
  204. m.TextureId = "rbxassetid://2766467"
  205. m.Scale = Vector3.new(0.07, 0.07, 0.07)
  206. gun.CFrame = char.Torso.CFrame
  207. gun.Parent = char
  208. local gunw = Instance.new("Weld", gun)
  209. gunw.Part0 = gun
  210. gunw.Part1 = char["Right Arm"]
  211. gunw.C0 = CFrame.new(-1.7838248, -0.410839319, 0, -0.0871557146, -0.996194541, 0, 0.996194541, -0.0871557146, 0, 0, 0, 1)
  212. mouse.Button1Down:connect(function()
  213.   local cf = gun.CFrame * CFrame.new(0, 0, 0.958)
  214.   local mag = (gun.Position - mouse.Hit.p).magnitude
  215.   local p = Instance.new("Part")
  216.   p.CanCollide = false
  217.   p.Anchored = false
  218.   p.BrickColor = BrickColor.new("Really red")
  219.   p.Size = Vector3.new(0.2, 0.2, mag)
  220.   smooth(p)
  221.   p.Material = "Neon"
  222.   p.CFrame = CFrame.new(gun.Position, mouse.Hit.p) * CFrame.new(0, 0, -mag / 2)
  223.   local m = Instance.new("SpecialMesh", p)
  224.   m.MeshType = "Brick"
  225.   p.Parent = workspace
  226.   p.Touched:connect(function(hit)
  227.     hurt(hit, "Kill")
  228.     if hit.Size.X > 100 and 100 < hit.Size.Z and hit.Size.Y < 3 then
  229.     elseif hit.Parent and hit.Parent.Name ~= plr.Name then
  230.       fade(hit, true)
  231.     end
  232.   end)
  233.   local bp = Instance.new("BodyPosition", p)
  234.   bp.MaxForce = huge
  235.   bp.Position = p.Position
  236.   local saved = p.CFrame
  237.   for i = 1, 10 do
  238.     p.Size = p.Size + Vector3.new(0.01, 0.01, 0.01)
  239.     p.CFrame = saved
  240.     p.Velocity = Vector3.new(0, 0, 100)
  241.     p.Transparency = p.Transparency + 0.1
  242.     wait()
  243.   end
  244.   p:Destroy()
  245. end)
  246. mouse.KeyDown:connect(function(key)
  247.   if key == "l" then
  248.     function a(b)
  249.       pcall(function()
  250.         for i, v in pairs(b:children()) do
  251.           pcall(function()
  252.             if v:IsA("BasePart") and v.Parent and v.Parent.Name == "WafflesAreVeryGood" and v.Anchored then
  253.               v.Anchored = false
  254.             end
  255.             if v:IsA("Sound") and v.Parent.Name ~= "WafflesAreVeryGood" then
  256.               v:Destroy()
  257.             end
  258.             if v:IsA("ParticleEmitter") then
  259.               v:Destroy()
  260.             end
  261.             a(v)
  262.           end)
  263.         end
  264.       end)
  265.     end
  266.     a(game)
  267.   end
  268.   if key == "q" then
  269.     local cf = gun.CFrame * CFrame.new(0, 0, 0.958)
  270.     local mag = (gun.Position - mouse.Hit.p).magnitude
  271.     local p = Instance.new("Part")
  272.     p.CanCollide = false
  273.     p.Anchored = false
  274.     p.BrickColor = BrickColor.new("Really red")
  275.     p.Size = Vector3.new(0.2, 0.2, mag)
  276.     smooth(p)
  277.     p.Material = "Neon"
  278.     p.CFrame = CFrame.new(gun.Position, mouse.Hit.p) * CFrame.new(0, 0, -mag / 2)
  279.     local m = Instance.new("SpecialMesh", p)
  280.     m.MeshType = "Brick"
  281.     p.Parent = workspace
  282.     p.Touched:connect(function(hit)
  283.       if gethum(hit) then
  284.         for i, v in pairs(hit.Parent:children()) do
  285.           if v:IsA("Model") then
  286.             v:BreakJoints()
  287.           end
  288.           local ok = false
  289.           for i, e in pairs({
  290.             "Right Arm",
  291.             "Left Arm",
  292.             "Right Leg",
  293.             "Left Leg",
  294.             "Head",
  295.             "Torso",
  296.             "HumanoidRootPart"
  297.           }) do
  298.             if v.Name == e then
  299.               ok = true
  300.             end
  301.           end
  302.           if v:IsA("BasePart") and not ok then
  303.             fade(v, true)
  304.           end
  305.         end
  306.       end
  307.       if hit:FindFirstChildOfClass("TouchTransmitter") then
  308.         hit:FindFirstChildOfClass("TouchTransmitter"):Destroy()
  309.       end
  310.     end)
  311.     local bp = Instance.new("BodyPosition", p)
  312.     bp.MaxForce = huge
  313.     bp.Position = p.Position
  314.     local saved = p.CFrame
  315.     for i = 1, 10 do
  316.       p.Size = p.Size + Vector3.new(0.01, 0.01, 0.01)
  317.       p.CFrame = saved
  318.       p.Velocity = Vector3.new(0, 0, 100)
  319.       p.Transparency = p.Transparency + 0.1
  320.       wait()
  321.     end
  322.     p:Destroy()
  323.   end
  324.   if key == "e" then
  325.     local cf = gun.CFrame * CFrame.new(0, 0, 0.958)
  326.     local mag = (gun.Position - mouse.Hit.p).magnitude
  327.     local p = Instance.new("Part")
  328.     p.CanCollide = false
  329.     p.Anchored = false
  330.     p.BrickColor = BrickColor.new("New Yeller")
  331.     p.Size = Vector3.new(0.2, 0.2, mag)
  332.     smooth(p)
  333.     p.Material = "Neon"
  334.     p.CFrame = CFrame.new(gun.Position, mouse.Hit.p) * CFrame.new(0, 0, -mag / 2)
  335.     local m = Instance.new("SpecialMesh", p)
  336.     m.MeshType = "Brick"
  337.     p.Parent = workspace
  338.     p.Touched:connect(function(hit)
  339.       if gethum(hit) then
  340.         local target = game.Players:FindFirstChild(hit.Parent.Name)
  341.         if target then
  342.           KICK(target)
  343.         end
  344.       end
  345.     end)
  346.     local bp = Instance.new("BodyPosition", p)
  347.     bp.MaxForce = huge
  348.     bp.Position = p.Position
  349.     local saved = p.CFrame
  350.     for i = 1, 10 do
  351.       p.Size = p.Size + Vector3.new(0.01, 0.01, 0.01)
  352.       p.CFrame = saved
  353.       p.Velocity = Vector3.new(0, 0, 100)
  354.       p.Transparency = p.Transparency + 0.1
  355.       wait()
  356.     end
  357.     p:Destroy()
  358.   end
  359.   if key == "r" then
  360.     local cf = gun.CFrame * CFrame.new(0, 0, 0.958)
  361.     local mag = (gun.Position - mouse.Hit.p).magnitude
  362.     local p = Instance.new("Part")
  363.     p.CanCollide = false
  364.     p.Anchored = false
  365.     p.BrickColor = BrickColor.new("Lime green")
  366.     p.Size = Vector3.new(0.2, 0.2, mag)
  367.     smooth(p)
  368.     p.Material = "Neon"
  369.     p.CFrame = CFrame.new(gun.Position, mouse.Hit.p) * CFrame.new(0, 0, -mag / 2)
  370.     local m = Instance.new("SpecialMesh", p)
  371.     m.MeshType = "Brick"
  372.     p.Parent = workspace
  373.     p.Touched:connect(function(hit)
  374.       local hum = gethum(hit)
  375.       if hum then
  376.         hum.Health = hum.MaxHealth
  377.       end
  378.     end)
  379.     local bp = Instance.new("BodyPosition", p)
  380.     bp.MaxForce = huge
  381.     bp.Position = p.Position
  382.     local saved = p.CFrame
  383.     for i = 1, 10 do
  384.       p.Size = p.Size + Vector3.new(0.01, 0.01, 0.01)
  385.       p.CFrame = saved
  386.       p.Velocity = Vector3.new(0, 0, 100)
  387.       p.Transparency = p.Transparency + 0.1
  388.       wait()
  389.     end
  390.     p:Destroy()
  391.   end
  392. end)
  393. game:GetService("RunService").Stepped:connect(function()
  394.   local x, z
  395.   local dir = CFrame.new(char.HumanoidRootPart.Position, mouse.Hit.p).lookVector
  396.   x = dir.X
  397.   z = dir.Z
  398.   local cf = CFrame.new(char.HumanoidRootPart.Position, char.HumanoidRootPart.Position + Vector3.new(x, 0, z))
  399.   char.HumanoidRootPart.CFrame = char.HumanoidRootPart.CFrame:Lerp(cf, 0.5)
  400.   humanoid.AutoRotate = false
  401. end)
  402. while wait() do
  403.   if animpose == "Walking" and cananim and legs then
  404.     for i = 0, 0.7, 0.1 do
  405.       if animpose == "Walking" and cananim and legs then
  406.         ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, 0, 0.104528472, -0.994522035, 0, 0.994522035, 0.104528472, 1, 0, 0), 0.2)
  407.         rs.C0 = rs.C0:Lerp(CFrame.new(1.54167628, 0.0454798974, 0, -0.482965499, -0.871292651, -0.087155737, -0.0422539636, -0.0762281716, 0.996195912, -0.874620378, 0.484809875, 0), 0.2)
  408.         neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -0.500000656, -0.866026223, 0, -1.61309954E-9, 9.31323796E-10, 1.00000024, -0.866026342, 0.500000715, -1.86264515E-9), 0.2)
  409.         rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -0.469472021, 0.882948279, 0, 0, 0, 1, 0.882948279, 0.469472021, 0), 0.2)
  410.         lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, -0.0219629817, 0.02712203, -0.999390841, -0.628937364, 0.776673257, 0.0348994955, 0.777146697, 0.6293208, 0), 0.4)
  411.         rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, 0.0238014236, -0.0255239103, 0.999390841, -0.681583524, 0.73090899, 0.0348994955, -0.731354535, -0.681998909, 0), 0.4)
  412.         wait()
  413.       else
  414.         break
  415.       end
  416.     end
  417.     for i = 0, 0.7, 0.1 do
  418.       if animpose == "Walking" and cananim and legs then
  419.         ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, 0, 0.104528472, -0.994522035, 0, 0.994522035, 0.104528472, 1, 0, 0), 0.2)
  420.         rs.C0 = rs.C0:Lerp(CFrame.new(1.54167628, 0.0454798974, 0, -0.482965499, -0.871292651, -0.087155737, -0.0422539636, -0.0762281716, 0.996195912, -0.874620378, 0.484809875, 0), 0.2)
  421.         neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -0.500000656, -0.866026223, 0, -1.61309954E-9, 9.31323796E-10, 1.00000024, -0.866026342, 0.500000715, -1.86264515E-9), 0.2)
  422.         rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -0.469472021, 0.882948279, 0, 0, 0, 1, 0.882948279, 0.469472021, 0), 0.2)
  423.         lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, 0.0205134545, 0.0282343514, -0.999390841, 0.587428331, 0.808525503, 0.0348994955, 0.809018135, -0.587786257, 0), 0.4)
  424.         rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, -0.0224330258, -0.0267346334, 0.999390841, 0.642397523, 0.765579402, 0.0348994955, -0.76604569, 0.642788768, 0), 0.4)
  425.         wait()
  426.       else
  427.         break
  428.       end
  429.     end
  430.   end
  431.   if animpose == "Idle" and cananim and legs then
  432.     ls.C0 = ls.C0:Lerp(CFrame.new(-1, 0.5, 0, 0, 0.104528472, -0.994522035, 0, 0.994522035, 0.104528472, 1, 0, 0), 0.2)
  433.     rs.C0 = rs.C0:Lerp(CFrame.new(1.54167628, 0.0454798974, 0, -0.482965499, -0.871292651, -0.087155737, -0.0422539636, -0.0762281716, 0.996195912, -0.874620378, 0.484809875, 0), 0.2)
  434.     neck.C0 = neck.C0:Lerp(CFrame.new(0, 1, 0, -0.500000656, -0.866026223, 0, -1.61309954E-9, 9.31323796E-10, 1.00000024, -0.866026342, 0.500000715, -1.86264515E-9), 0.2)
  435.     rj.C0 = rj.C0:Lerp(CFrame.new(0, 0, 0, -0.469472021, 0.882948279, 0, 0, 0, 1, 0.882948279, 0.469472021, 0), 0.2)
  436.     lh.C0 = lh.C0:Lerp(CFrame.new(-1, -1, 0, 0, 0.0523359552, -0.99862957, 0, 0.99862957, 0.0523359552, 1, 0, 0), 0.5)
  437.     rh.C0 = rh.C0:Lerp(CFrame.new(1, -1, 0, 0, -0.0523359627, 0.998629689, 0, 0.998629689, 0.0523359627, -1, 0, 0), 0.5)
  438.   end
  439. end
Add Comment
Please, Sign In to add comment