Advertisement
Rufus14

Anti-Script EMP Shockmine

Jun 17th, 2019
1,654
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.28 KB | None | 0 0
  1. --use it to stop abusers (By Rufus14)
  2. --owner = game.Players[script.Parent.Name]
  3. heartbeat = game:GetService("RunService").Heartbeat
  4. --Converted with ttyyuu12345's model to script plugin v4
  5. function sandbox(var,func)
  6.     local env = getfenv(func)
  7.     local newenv = setmetatable({},{
  8.         __index = function(self,k)
  9.             if k=="script" then
  10.                 return var
  11.             else
  12.                 return env[k]
  13.             end
  14.         end,
  15.     })
  16.     setfenv(func,newenv)
  17.     return func
  18. end
  19. cors = {}
  20. mas = Instance.new("Model",game:GetService("Lighting"))
  21. Tool0 = Instance.new("Tool")
  22. Part1 = Instance.new("Part")
  23. SpecialMesh2 = Instance.new("SpecialMesh")
  24. Tool0.Name = "EMP"
  25. Tool0.Parent = mas
  26. Tool0.TextureId = "http://www.roblox.com/asset/?id=28516273"
  27. Tool0.Grip = CFrame.new(-0.100000001, 0, 0, 0, 0, -1, -0, 1, 0, 1, 0, 0)
  28. Tool0.GripForward = Vector3.new(1, -0, -0)
  29. Tool0.GripPos = Vector3.new(-0.100000001, 0, 0)
  30. Tool0.GripRight = Vector3.new(0, -0, 1)
  31. Part1.Name = "Handle"
  32. Part1.Parent = Tool0
  33. Part1.CFrame = CFrame.new(-14.6855946, 1.64969444, 1.09493446, -0.356071234, -0.934458971, -0.000232726336, -0.000399976969, 0.000401377678, -0.999999881, 0.934458852, -0.356070966, -0.00051677227)
  34. Part1.Orientation = Vector3.new(89.9700012, -155.759995, -44.9000015)
  35. Part1.Position = Vector3.new(-14.6855946, 1.64969444, 1.09493446)
  36. Part1.Rotation = Vector3.new(90.0299988, -0.00999999978, 110.860001)
  37. Part1.Size = Vector3.new(0.259999901, 1.43999982, 0.309999973)
  38. Part1.BottomSurface = Enum.SurfaceType.Smooth
  39. Part1.TopSurface = Enum.SurfaceType.Smooth
  40. SpecialMesh2.Parent = Part1
  41. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=28511792"
  42. SpecialMesh2.Scale = Vector3.new(2, 2, 2)
  43. SpecialMesh2.VertexColor = Vector3.new(1, 1, 2)
  44. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=28511890"
  45. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  46. for i,v in pairs(mas:GetChildren()) do
  47.     v.Parent = workspace
  48.     pcall(function() v:MakeJoints() end)
  49. end
  50. mas:Destroy()
  51. for i,v in pairs(cors) do
  52.     spawn(function()
  53.         pcall(v)
  54.     end)
  55. end
  56. Tool0.Parent = owner.Character
  57. canuse = true
  58. local sound = Instance.new("Sound", Part1)
  59. sound.Name = "EMPSounds"
  60. sound.SoundId = "http://www.roblox.com/asset/?id=28518380"
  61. function use()
  62.     if canuse then
  63.         canuse = false
  64.         local user = Tool0.Parent
  65.         if user:findFirstChild("Torso") then
  66.             local rightarm = Instance.new("Weld", user.Torso)
  67.             rightarm.Part0 = user.Torso
  68.             rightarm.Part1 = user["Right Arm"]
  69.             rightarm.C0 = CFrame.new(1.5, 0.502278805, -0.499994755, 1, 0, 0, 0, -0.00455739861, -0.999989569, 0, 0.999989629, -0.00455739908)
  70.             rightarm.Name = "RightArmWeld"
  71.             local leftarm = Instance.new("Weld", user.Torso)
  72.             leftarm.Part0 = user.Torso
  73.             leftarm.Part1 = user["Left Arm"]
  74.             leftarm.C0 = CFrame.new(-1.5,0,0)
  75.             leftarm.Name = "LeftArmWeld"
  76.             for i = 0,0.7 , 0.06 do
  77.                 rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.43301272, 0.466506481, -0.558012724, 0.866025388, 0, 0.5, 0.433012664, 0.49999997, -0.74999994, -0.25, 0.866025388, 0.433012694),i)
  78.                 leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5, 0.75, -0.433012724, 0.99999994, 0, 0, 0, -0.5, -0.866025329, 0, 0.866025388, -0.50000006),i)
  79.                 heartbeat:wait()
  80.             end
  81.             for i = 0,0.7 , 0.06 do
  82.                 rightarm.C0 = rightarm.C0:lerp(CFrame.new(0.7997365, 0.807039261, -0.604666471, 0.194529414, 0.595056415, 0.779785991, 0.872452438, 0.258374363, -0.414812416, -0.448313534, 0.761019349, -0.468896985),i)
  83.                 leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.18681097, 0.763025284, -0.629221201, 0.866025329, -0.492403895, -0.0868238211, -0.249999896, -0.276050836, -0.928060293, 0.433012754, 0.825429797, -0.362167984),i)
  84.                 heartbeat:wait()
  85.             end
  86.         end
  87.         Part1.EMPSounds.Volume = 1
  88.         Part1.EMPSounds.SoundId = "http://www.roblox.com/asset/?id=28518380"
  89.         Part1.EMPSounds:Play()
  90.         wait(Part1.EMPSounds.TimeLength)
  91.         Part1.EMPSounds:Stop()
  92.         local soundrandom = math.random(1,2)
  93.         if soundrandom == 1 then
  94.             Part1.EMPSounds.SoundId = "rbxassetid://335657174"
  95.         elseif soundrandom == 2 then
  96.             Part1.EMPSounds.SoundId = "rbxassetid://178452217"
  97.         end
  98.         Part1.EMPSounds:Play()
  99.         Part1.EMPSounds.Volume = 3
  100.         local function searchforscripts(what)
  101.             for i,v in pairs(what:GetChildren()) do
  102.                 if v.ClassName == "LocalScript" or v.ClassName == "Script" then
  103.                     v.Disabled = true
  104.                 end
  105.                 if v.ClassName == "Sound" and v.Parent.Name ~= "Head" then
  106.                     v:Stop()
  107.                 end
  108.                 searchforscripts(v)
  109.             end
  110.         end
  111.         local function searchforscripts2(what)
  112.             for i,v in pairs(what:GetChildren()) do
  113.                 if v.ClassName == "LocalScript" or v.ClassName == "Script" then
  114.                     v.Disabled = false
  115.                 end
  116.                 if v.ClassName == "Sound" and v.Parent.Name ~= "Head" then
  117.                     v:Play()
  118.                 end
  119.                 searchforscripts2(v)
  120.             end
  121.         end
  122.         for i,v in pairs(workspace:GetChildren()) do
  123.             if v.ClassName == "Model" and v ~= user then
  124.                 local thepart = v:findFirstChildOfClass("Part")
  125.                 if thepart then
  126.                     if (thepart.Position - Part1.Position).magnitude <= 120 then
  127.                         local sparkles = Instance.new("Sparkles", thepart)
  128.                         sparkles.Name = "punishment"
  129.                         game.Debris:AddItem(sparkles, 10)
  130.                         searchforscripts(v)
  131.                         local function waitforrrthat()
  132.                             wait(10)
  133.                             if not thepart:findFirstChild("punishment") then
  134.                                 searchforscripts2(v)
  135.                             end
  136.                         end
  137.                         spawn(waitforrrthat)
  138.                     end
  139.                 end
  140.             end
  141.         end
  142.         local function waitforend()
  143.             wait(Part1.EMPSounds.TimeLength)
  144.             if not Part1.EMPSounds.Playing then
  145.                 Part1.EMPSounds.Volume = 1
  146.             end
  147.         end
  148.         spawn(waitforend)
  149.         local function shake()
  150.             for i = 1,20 do
  151.                 wait()
  152.                 user:findFirstChildOfClass("Humanoid").CameraOffset = Vector3.new(0,1,0)
  153.             end
  154.         end
  155.         spawn(shake)
  156.         local shockpart = Instance.new("Part", Part1)
  157.         shockpart.Anchored = true
  158.         shockpart.CanCollide = false
  159.         shockpart.Transparency = 0
  160.         shockpart.Size = Vector3.new(1,1,1)
  161.         shockpart.CFrame = user.Head.CFrame
  162.         shockpart.CFrame = (shockpart.CFrame - shockpart.Position) + Vector3.new(Part1.Position.x,Part1.Position.y,Part1.Position.z)
  163.         local shockMesh = Instance.new("SpecialMesh")
  164.         shockMesh.MeshId = "http://www.roblox.com/asset/?id=54068514"
  165.         shockMesh.VertexColor = Vector3.new(0,0,1)
  166.         shockMesh.TextureId = "http://www.roblox.com/asset/?id=54068645"
  167.         shockMesh.Scale = Vector3.new(1,1,1)
  168.         shockMesh.Parent = shockpart
  169.         local function resize()
  170.             while shockpart.Transparency < 1 do
  171.                 shockMesh.Scale = shockMesh.Scale + Vector3.new(0.6,0.1,0.6)
  172.                 shockpart.Transparency = shockpart.Transparency + 0.015
  173.                 shockpart.CFrame = shockpart.CFrame * CFrame.fromEulerAnglesXYZ(0,0.03,0)
  174.                 heartbeat:wait()
  175.             end
  176.         end
  177.         spawn(resize)
  178.         canuse = true
  179.         if user:findFirstChild("Torso") then
  180.             for i = 0,0.7 , 0.06 do
  181.                 user.Torso.RightArmWeld.C0 = user.Torso.RightArmWeld.C0:lerp(CFrame.new(1.5, 0.502278805, -0.499994755, 1, 0, 0, 0, -0.00455739861, -0.999989569, 0, 0.999989629, -0.00455739908),i)
  182.                 user.Torso.LeftArmWeld.C0 = user.Torso.LeftArmWeld.C0:lerp(CFrame.new(-1.5,0,0),i)
  183.                 heartbeat:wait()
  184.             end
  185.             user.Torso.RightArmWeld:destroy()
  186.             user.Torso.LeftArmWeld:destroy()
  187.         end
  188.     end
  189. end
  190. Tool0.Activated:connect(use)
  191. while heartbeat:wait() do
  192.     if not Part1:findFirstChild("EMPSounds") then
  193.         local sound = Instance.new("Sound", Part1)
  194.         sound.SoundId = "http://www.roblox.com/asset/?id=28518380"
  195.         sound.Name = "EMPSounds"
  196.     end
  197. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement