KrYn0MoRe

taser

Apr 8th, 2021 (edited)
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.07 KB | None | 0 0
  1. local plr = owner
  2. local char = plr.Character
  3. local hum = char:FindFirstChildOfClass("Humanoid")
  4. local torso = char['Torso'] or char['UpperTorso']
  5.  
  6. Tool0 = Instance.new("Tool")
  7. Part1 = Instance.new("Part")
  8. SpecialMesh2 = Instance.new("SpecialMesh")
  9. Sound3 = Instance.new("Sound")
  10. Sound4 = Instance.new("Sound")
  11. Tool0.Name = "Taser"
  12. Tool0.CanBeDropped = false
  13. Tool0.ToolTip = "taser them skids"
  14. Tool0.TextureId = "rbxassetid://517843292"
  15. Tool0.Parent = plr.Backpack
  16. Part1.Name = "Handle"
  17. Part1.Parent = Tool0
  18. Part1.CFrame = CFrame.new(-17.4752846, 1.57726252, 10.3508625, 0.152027637, -0.454833627, -0.877504945, 1.38640985e-07, 0.887824535, -0.460182667, 0.988376021, 0.069960326, 0.134974062)
  19. Part1.Orientation = Vector3.new(27.3999996, -81.2600021, 0)
  20. Part1.Position = Vector3.new(-17.4752846, 1.57726252, 10.3508625)
  21. Part1.Rotation = Vector3.new(73.6500015, -61.3400002, 71.5199966)
  22. Part1.Color = Color3.new(0.105882, 0.164706, 0.207843)
  23. Part1.Size = Vector3.new(1, 2.10799956, 2.7879982)
  24. Part1.BottomSurface = Enum.SurfaceType.Smooth
  25. Part1.BrickColor = BrickColor.new("Black")
  26. Part1.Locked = true
  27. Part1.TopSurface = Enum.SurfaceType.Smooth
  28. Part1.brickColor = BrickColor.new("Black")
  29. Part1.FormFactor = Enum.FormFactor.Custom
  30. Part1.formFactor = Enum.FormFactor.Custom
  31. SpecialMesh2.Parent = Part1
  32. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=82337638"
  33. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=82337709"
  34. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  35. Sound3.Name = "EquippedSound"
  36. Sound3.Parent = Part1
  37. Sound3.EmitterSize = 1
  38. Sound3.SoundId = "rbxassetid://138244068"
  39. Sound3.Volume = 5
  40. Sound4.Name = "FireSound"
  41. Sound4.Parent = Part1
  42. Sound4.Looped = true
  43. Sound4.EmitterSize = 1
  44. Sound4.SoundId = "rbxassetid://277635663"
  45. Sound4.Volume = 10
  46. FlangeSoundEffect0 = Instance.new("FlangeSoundEffect",Sound4)
  47. FlangeSoundEffect0.Rate = 10
  48. FlangeSoundEffect0.Depth = 0.5
  49. FlangeSoundEffect0.Mix = 1
  50. FlangeSoundEffect1 = Instance.new("FlangeSoundEffect",Sound3)
  51. FlangeSoundEffect1.Rate = 10
  52. FlangeSoundEffect1.Depth = 1
  53. FlangeSoundEffect1.Mix = 1
  54.  
  55. local tool = Tool0
  56. local handle = Part1
  57.  
  58. local debris = game:GetService("Debris")
  59. local tween = game:GetService("TweenService")
  60.  
  61. local using = false
  62. local equipped = false
  63.  
  64. function tase(hitbox)
  65.     local connection
  66.     connection = hitbox.Touched:Connect(function(obj)
  67.         local hum = obj.Parent:FindFirstChildOfClass("Humanoid")
  68.         local targchar = obj.Parent
  69.         if obj and targchar and hum and hum.Parent and targchar ~= char and targchar.ClassName == "Model" and not targchar:FindFirstChild("got taser phasered") then
  70.             local confirm = Instance.new("IntValue")
  71.             confirm.Parent = targchar
  72.             confirm.Name = "got taser phasered"
  73.             local tasing = true
  74.             spawn(function()
  75.                 wait(2)
  76.                 tasing = false
  77.                 confirm:Destroy()
  78.             end)
  79.             spawn(function()
  80.                 while targchar and targchar.Parent and tasing do
  81.                     if math.random(1,2) == 1 then
  82.                         if hum then
  83.                             hum.Sit = true
  84.                         end
  85.                     else
  86.                         if hum then
  87.                             hum.Sit = false
  88.                         end
  89.                     end
  90.                     wait()
  91.                     hum.WalkSpeed = 0
  92.                     for i,v in pairs(targchar:GetDescendants()) do
  93.                         if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") or v:IsA("BasePart") then
  94.                             v.CFrame = v.CFrame * CFrame.Angles(math.rad(math.random(-20,20)/10),math.rad(math.random(-20,20)/10),math.rad(math.random(-20,20)/10))
  95.                             v.Rotation = v.Rotation * math.random(-2,2) --(math.random(-10,10)/10)
  96.                         end
  97.                     end
  98.                 end
  99.                 --[[
  100.                 spawn(function()
  101.                     while targchar do
  102.                         wait()
  103.                         if hum then
  104.                             hum.MaxHealth = 0
  105.                             hum.Health = 0
  106.                         end
  107.                         if targchar then
  108.                             targchar:BreakJoints()
  109.                         end
  110.                     end
  111.                 end)
  112.                 ]]
  113.             end)
  114.         end
  115.     end)
  116.     wait(5)
  117.     connection:Disconnect()
  118. end
  119.  
  120. tool.Equipped:Connect(function()
  121.     equipped = true
  122.     Sound3:Play()
  123. end)
  124. tool.Unequipped:Connect(function()
  125.     equipped = false
  126.     Sound3:Stop()
  127. end)
  128.  
  129. Tool0.Activated:Connect(function()
  130.     if equipped and not using then
  131.         using = true
  132.         Sound4:Play()
  133.         tase(Part1)
  134.         Sound4:Stop()
  135.         using = false
  136.     end
  137. end)
Add Comment
Please, Sign In to add comment