Advertisement
teotv202

flash bang

Jun 26th, 2019
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 20.08 KB | None | 0 0
  1. print'Click to Throw FlashBang'
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player = owner
  4. local Mouse,mouse,UserInputService,ContextActionService
  5. do
  6.     script.Parent = RhiBel00351
  7.     local CAS = {Actions={}}
  8.     local Event = Instance.new("RemoteEvent")
  9.     Event.Name = "UserInput_Event"
  10.     Event.Parent = Player.Character
  11.     local fakeEvent = function()
  12.         local t = {_fakeEvent=true}
  13.         t.Connect = function(self,f)self.Function=f end
  14.         t.connect = t.Connect
  15.         return t
  16.     end
  17.     local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  18.     local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  19.     function CAS:BindAction(name,fun,touch,...)
  20.         CAS.Actions[name] = {Name=name,Function=fun,Keys={...}}
  21.     end
  22.     function CAS:UnbindAction(name)
  23.         CAS.Actions[name] = nil
  24.     end
  25.     local function te(self,ev,...)
  26.         local t = m[ev]
  27.         if t and t._fakeEvent and t.Function then
  28.             t.Function(...)
  29.         end
  30.     end
  31.     m.TrigEvent = te
  32.     UIS.TrigEvent = te
  33.     Event.OnServerEvent:Connect(function(plr,io)
  34.         if plr~=Player then return end
  35.         if io.isMouse then
  36.             m.Target = io.Target
  37.             m.Hit = io.Hit
  38.         elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
  39.             if io.UserInputState == Enum.UserInputState.Begin then
  40.                 m:TrigEvent("Button1Down")
  41.             else
  42.                 m:TrigEvent("Button1Up")
  43.             end
  44.         else
  45.             for n,t in pairs(CAS.Actions) do
  46.                 for _,k in pairs(t.Keys) do
  47.                     if k==io.KeyCode then
  48.                         t.Function(t.Name,io.UserInputState,io)
  49.                     end
  50.                 end
  51.             end
  52.             if io.UserInputState == Enum.UserInputState.Begin then
  53.                 m:TrigEvent("KeyDown",io.KeyCode.Name:lower())
  54.                 UIS:TrigEvent("InputBegan",io,false)
  55.             else
  56.                 m:TrigEvent("KeyUp",io.KeyCode.Name:lower())
  57.                 UIS:TrigEvent("InputEnded",io,false)
  58.             end
  59.         end
  60.     end)
  61.     NLS([==[
  62.     local Player = game:GetService("Players").LocalPlayer
  63.    
  64.     local Char = Player.Character
  65.     local Event = Char:WaitForChild("UserInput_Event")
  66.    
  67.     local UIS = game:GetService("UserInputService")
  68.    
  69.     local input = function(io,a)
  70.         if a then return end
  71.         local io = {KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState}
  72.         Event:FireServer(io)
  73.     end
  74.     UIS.InputBegan:Connect(input)
  75.     UIS.InputEnded:Connect(input)
  76.     local Changed = false
  77.     local Mouse = Player:GetMouse()
  78.     local h,t = Mouse.Hit,Mouse.Target
  79.     while wait(1/30) do
  80.         if h~=Mouse.Hit or t~=Mouse.Target then
  81.             Event:FireServer({isMouse=true,Target=Mouse.Target,Hit=Mouse.Hit})
  82.             h,t=Mouse.Hit,Mouse.Target
  83.         end
  84.     end
  85.     ]==],Player.Character)
  86.     Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  87. end
  88. local plr = owner
  89. local char = plr.Character
  90. local mytorso = char.Torso
  91. blindedbois = {}
  92. canuse = true
  93. function canusee(key)
  94.     key = key:lower()
  95.     if key == "z" then
  96.         canuse = true
  97.     end
  98.     if key == "x" then
  99.         canuse = false
  100.     end
  101. end
  102. function throw()
  103.     if canuse then
  104.         canuse = false
  105.         --Converted with ttyyuu12345's model to script plugin v4
  106.         local function sandbox(var,func)
  107.             local env = getfenv(func)
  108.             local newenv = setmetatable({},{
  109.                 __index = function(self,k)
  110.                     if k=="script" then
  111.                         return var
  112.                     else
  113.                         return env[k]
  114.                     end
  115.                 end,
  116.             })
  117.             setfenv(func,newenv)
  118.             return func
  119.         end
  120.         local cors = {}
  121.         local mas = Instance.new("Model",game:GetService("Lighting"))
  122.         local Part0 = Instance.new("Part")
  123.         local SpecialMesh1 = Instance.new("SpecialMesh")
  124.         Part0.Name = "Handle"
  125.         Part0.Parent = mas
  126.         Part0.BrickColor = BrickColor.new("Earth green")
  127.         Part0.Rotation = Vector3.new(0, 90, 0)
  128.         Part0.FormFactor = Enum.FormFactor.Symmetric
  129.         Part0.Size = Vector3.new(1, 2, 1)
  130.         Part0.CFrame = CFrame.new(2.5, 6.00001717, -26, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  131.         Part0.BottomSurface = Enum.SurfaceType.Smooth
  132.         Part0.TopSurface = Enum.SurfaceType.Smooth
  133.         Part0.Color = Color3.new(0.152941, 0.27451, 0.176471)
  134.         Part0.Position = Vector3.new(2.5, 6.00001717, -26)
  135.         Part0.Orientation = Vector3.new(0, 90, 0)
  136.         Part0.Color = Color3.new(0.152941, 0.27451, 0.176471)
  137.         SpecialMesh1.Parent = Part0
  138.         SpecialMesh1.MeshId = "http://www.roblox.com/asset/?id=16975131"
  139.         SpecialMesh1.Scale = Vector3.new(0.600000024, 0.699999988, 0.600000024)
  140.         SpecialMesh1.TextureId = "http://www.roblox.com/asset/?id=16975111"
  141.         SpecialMesh1.MeshType = Enum.MeshType.FileMesh
  142.         SpecialMesh1.Scale = Vector3.new(0.600000024, 0.699999988, 0.600000024)
  143.         for i,v in pairs(mas:GetChildren()) do
  144.             v.Parent = char
  145.             pcall(function() v:MakeJoints() end)
  146.         end
  147.         mas:Destroy()
  148.         for i,v in pairs(cors) do
  149.             spawn(function()
  150.                 pcall(v)
  151.             end)
  152.         end
  153.         Part0.CFrame = char["Right Arm"].CFrame * CFrame.new(0,0,-0.5)
  154.         for i = 1,15 do
  155.             Part0.Velocity = mouse.Hit.lookVector * 66
  156.             wait()
  157.         end
  158.         wait(2)
  159.         --Sound2:Play()
  160.         local ow = Instance.new("Part", char)
  161.         ow.CanCollide = false
  162.         ow.Anchored = true
  163.         ow.Shape = "Ball"
  164.         ow.Material = "Neon"
  165.         ow.Size = Vector3.new(1,1,1)
  166.         ow.CFrame = Part0.CFrame
  167.         for i = 1,7 do
  168.             ow.Size = ow.Size + Vector3.new(7,7,7)
  169.             ow.CFrame = Part0.CFrame
  170.             game:GetService("RunService").Stepped:wait()
  171.         end
  172.         for i,v in pairs(game.Players:GetChildren()) do
  173.             if v.Character and v.Name ~= owner.Name then
  174.                 local head = v.Character:findFirstChild("Head")
  175.                 if head then
  176.                     if ((head.Position - ow.Position).magnitude < math.random(50,64)) then
  177.                         v.CameraMode = "LockFirstPerson"
  178.                         --Converted with ttyyuu12345's model to script plugin v4
  179.                         function sandbox(var,func)
  180.                             local env = getfenv(func)
  181.                             local newenv = setmetatable({},{
  182.                                 __index = function(self,k)
  183.                                     if k=="script" then
  184.                                         return var
  185.                                     else
  186.                                         return env[k]
  187.                                     end
  188.                                 end,
  189.                             })
  190.                             setfenv(func,newenv)
  191.                             return func
  192.                         end
  193.                         cors = {}
  194.                         mas = Instance.new("Model",game:GetService("Lighting"))
  195.                         local Model0 = Instance.new("Model")
  196.                         local Part1 = Instance.new("Part")
  197.                         local Part2 = Instance.new("Part")
  198.                         local Weld3 = Instance.new("Weld")
  199.                         local Weld4 = Instance.new("Weld")
  200.                         local Weld5 = Instance.new("Weld")
  201.                         local Weld6 = Instance.new("Weld")
  202.                         local Weld7 = Instance.new("Weld")
  203.                         local Weld8 = Instance.new("Weld")
  204.                         local Part9 = Instance.new("Part")
  205.                         local Part10 = Instance.new("Part")
  206.                         local Part11 = Instance.new("Part")
  207.                         local Part12 = Instance.new("Part")
  208.                         Model0.Parent = mas
  209.                         Part1.Parent = Model0
  210.                         Part1.Material = Enum.Material.Neon
  211.                         Part1.Rotation = Vector3.new(-0.0899999961, -28.2699986, -0.0399999991)
  212.                         Part1.RotVelocity = Vector3.new(0.0414423086, 6.61378124e-07, 0.0222902913)
  213.                         Part1.Velocity = Vector3.new(0.00411429629, -0.0155075621, -0.00764747709)
  214.                         Part1.CanCollide = false
  215.                         Part1.Size = Vector3.new(0.78333354, 3.9166677, 3.9166677)
  216.                         Part1.CFrame = CFrame.new(-1.42134643, 7.36401653, -0.278908014, 0.880764902, 0.000630680006, -0.47355336, 4.90961725e-07, 0.999999106, 0.0013327155, 0.473553777, -0.00117404154, 0.880764127)
  217.                         Part1.BottomSurface = Enum.SurfaceType.Smooth
  218.                         Part1.TopSurface = Enum.SurfaceType.Smooth
  219.                         Part1.Position = Vector3.new(-1.42134643, 7.36401653, -0.278908014)
  220.                         Part1.Orientation = Vector3.new(-0.0799999982, -28.2699986, 0)
  221.                         Part2.Parent = Model0
  222.                         Part2.Material = Enum.Material.Neon
  223.                         Part2.Rotation = Vector3.new(-0.0899999961, -28.2699986, -0.0399999991)
  224.                         Part2.RotVelocity = Vector3.new(0.0414423086, 6.61378124e-07, 0.0222902913)
  225.                         Part2.Velocity = Vector3.new(0.0390362106, -0.0155943036, -0.072574608)
  226.                         Part2.CanCollide = false
  227.                         Part2.Size = Vector3.new(3.9166677, 0.78333354, 3.9166677)
  228.                         Part2.CFrame = CFrame.new(-0.0424690843, 5.79735136, 0.464832425, 0.880764902, 0.000630680006, -0.47355336, 4.90961725e-07, 0.999999106, 0.0013327155, 0.473553777, -0.00117404154, 0.880764127)
  229.                         Part2.BottomSurface = Enum.SurfaceType.Smooth
  230.                         Part2.TopSurface = Enum.SurfaceType.Smooth
  231.                         Part2.Position = Vector3.new(-0.0424690843, 5.79735136, 0.464832425)
  232.                         Part2.Orientation = Vector3.new(-0.0799999982, -28.2699986, 0)
  233.                         Weld3.Parent = Part2
  234.                         Weld3.C0 = CFrame.new(0, 1.56666708, 1.56666708, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  235.                         Weld3.Part0 = Part2
  236.                         Weld3.Part1 = Part12
  237.                         Weld4.Parent = Part2
  238.                         Weld4.C0 = CFrame.new(-1.56666708, 1.56666708, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  239.                         Weld4.Part0 = Part2
  240.                         Weld4.Part1 = Part1
  241.                         Weld5.Parent = Part2
  242.                         Weld5.C0 = CFrame.new(1.56666708, 1.56666708, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  243.                         Weld5.Part0 = Part2
  244.                         Weld5.Part1 = Part9
  245.                         Weld6.Parent = Part2
  246.                         Weld6.C0 = CFrame.new(0.39166677, 1.56666708, -1.56666708, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  247.                         Weld6.Part0 = Part2
  248.                         Weld6.Part1 = Part10
  249.                         Weld7.Parent = Part2
  250.                         Weld7.C0 = CFrame.new(0, 3.9166677, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  251.                         Weld7.Part0 = Part2
  252.                         Weld7.Part1 = Part11
  253.                         Weld8.Parent = Part2
  254.                         Weld8.C0 = CFrame.new(0, -1.56666696, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  255.                         Weld8.Part1 = Part2
  256.                         Part9.Parent = Model0
  257.                         Part9.Material = Enum.Material.Neon
  258.                         Part9.Rotation = Vector3.new(-0.0899999961, -28.2699986, -0.0399999991)
  259.                         Part9.RotVelocity = Vector3.new(0.0414423086, 6.61378124e-07, 0.0222902913)
  260.                         Part9.Velocity = Vector3.new(0.00411525369, -0.0154845472, -0.00764926523)
  261.                         Part9.CanCollide = false
  262.                         Part9.Size = Vector3.new(0.78333354, 3.9166677, 3.9166677)
  263.                         Part9.CFrame = CFrame.new(1.33838439, 7.36401749, 1.20489419, 0.880764902, 0.000630680006, -0.47355336, 4.90961725e-07, 0.999999106, 0.0013327155, 0.473553777, -0.00117404154, 0.880764127)
  264.                         Part9.BottomSurface = Enum.SurfaceType.Smooth
  265.                         Part9.TopSurface = Enum.SurfaceType.Smooth
  266.                         Part9.Position = Vector3.new(1.33838439, 7.36401749, 1.20489419)
  267.                         Part9.Orientation = Vector3.new(-0.0799999982, -28.2699986, 0)
  268.                         Part10.Parent = Model0
  269.                         Part10.Material = Enum.Material.Neon
  270.                         Part10.Rotation = Vector3.new(-0.0899999961, -28.2699986, -0.0399999991)
  271.                         Part10.RotVelocity = Vector3.new(0.0414423086, 6.61378124e-07, 0.0222902913)
  272.                         Part10.Velocity = Vector3.new(0.00416051969, 0.058228761, -0.00773560256)
  273.                         Part10.CanCollide = false
  274.                         Part10.Size = Vector3.new(3.13333416, 3.9166677, 0.78333354)
  275.                         Part10.CFrame = CFrame.new(1.04538584, 7.36192942, -0.731395841, 0.880764902, 0.000630680006, -0.47355336, 4.90961725e-07, 0.999999106, 0.0013327155, 0.473553777, -0.00117404154, 0.880764127)
  276.                         Part10.BottomSurface = Enum.SurfaceType.Smooth
  277.                         Part10.TopSurface = Enum.SurfaceType.Smooth
  278.                         Part10.Position = Vector3.new(1.04538584, 7.36192942, -0.731395841)
  279.                         Part10.Orientation = Vector3.new(-0.0799999982, -28.2699986, 0)
  280.                         Part11.Parent = Model0
  281.                         Part11.Material = Enum.Material.Neon
  282.                         Part11.Rotation = Vector3.new(-0.0899999961, -28.2699986, -0.0399999991)
  283.                         Part11.RotVelocity = Vector3.new(0.0414423086, 6.61378124e-07, 0.0222902913)
  284.                         Part11.Velocity = Vector3.new(-0.0482673831, -0.0153486775, 0.0897410139)
  285.                         Part11.CanCollide = false
  286.                         Part11.Size = Vector3.new(3.9166677, 0.78333354, 3.9166677)
  287.                         Part11.CFrame = CFrame.new(-0.0399989188, 9.71401596, 0.460234106, 0.880764902, 0.000630680006, -0.47355336, 4.90961725e-07, 0.999999106, 0.0013327155, 0.473553777, -0.00117404154, 0.880764127)
  288.                         Part11.BottomSurface = Enum.SurfaceType.Smooth
  289.                         Part11.TopSurface = Enum.SurfaceType.Smooth
  290.                         Part11.Position = Vector3.new(-0.0399989188, 9.71401596, 0.460234106)
  291.                         Part11.Orientation = Vector3.new(-0.0799999982, -28.2699986, 0)
  292.                         Part12.Parent = Model0
  293.                         Part12.Material = Enum.Material.Neon
  294.                         Part12.Rotation = Vector3.new(-0.0899999961, -28.2699986, -0.0399999991)
  295.                         Part12.RotVelocity = Vector3.new(0.0414423086, 6.61378124e-07, 0.0222902913)
  296.                         Part12.Velocity = Vector3.new(0.00406914484, -0.0892179906, -0.00756134093)
  297.                         Part12.CanCollide = false
  298.                         Part12.Size = Vector3.new(3.9166677, 3.9166677, 0.78333354)
  299.                         Part12.CFrame = CFrame.new(-0.783381462, 7.36610508, 1.84285736, 0.880764902, 0.000630680006, -0.47355336, 4.90961725e-07, 0.999999106, 0.0013327155, 0.473553777, -0.00117404154, 0.880764127)
  300.                         Part12.BottomSurface = Enum.SurfaceType.Smooth
  301.                         Part12.TopSurface = Enum.SurfaceType.Smooth
  302.                         Part12.Position = Vector3.new(-0.783381462, 7.36610508, 1.84285736)
  303.                         Part12.Orientation = Vector3.new(-0.0799999982, -28.2699986, 0)
  304.                         for i,v in pairs(mas:GetChildren()) do
  305.                             v.Parent = owner.Character
  306.                             pcall(function() v:MakeJoints() end)
  307.                         end
  308.                         mas:Destroy()
  309.                         for i,v in pairs(cors) do
  310.                             spawn(function()
  311.                                 pcall(v)
  312.                             end)
  313.                         end
  314.                         for q,w in pairs(Model0:GetChildren()) do
  315.                             w.CanCollide = false
  316.                         end
  317.                         Part2.CFrame = head.CFrame
  318.                         local weld = Instance.new("Weld", Part2)
  319.                         weld.Part0 = head
  320.                         weld.Part1 = Part2
  321.                         weld.C0 = CFrame.new(0,-2,0)
  322.                         local blindval = 0
  323.                         local candooo = true
  324.                         local function doblind()
  325.                             if candooo then
  326.                                 blindval = blindval + 1
  327.                                 if blindval > 300 then
  328.                                     for q,w in pairs(Model0:GetChildren()) do
  329.                                         w.Transparency = w.Transparency + 0.005
  330.                                     end
  331.                                     if blindval > 500 then
  332.                                         candooo = false
  333.                                         blindval = 0
  334.                                         Model0:destroy()
  335.                                         bs1:destroy()
  336.                                         bs11:destroy()
  337.                                         bs111:destroy()
  338.                                         bs1111:destroy()
  339.                                         bs11111:destroy()
  340.                                         v.CameraMode = "Classic"
  341.                                     end
  342.                                 end
  343.                             end
  344.                         end
  345.                         game:GetService("RunService").Stepped:connect(doblind)
  346.                     end
  347.                 end
  348.             end
  349.         end
  350.         ow:destroy()
  351.         Part0:destroy()
  352.         wait(0.5)
  353.         canuse = true
  354.     end
  355. end
  356. mouse.Button1Down:connect(throw)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement