Advertisement
ItzInfern

smoke granate

Jan 5th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.53 KB | None | 0 0
  1.  
  2.  
  3.  
  4. --https://github.com/Mokiros/roblox-FE-compatibility
  5. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  6. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  7. local RealPlayer = Player
  8. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end
  9.  
  10.  
  11. --Windows95/FR34KY @V3rm
  12. local player=game.Players.LocalPlayer;
  13. local char=game.Players.LocalPlayer.Character;
  14. local humanoid = player.Character.Humanoid;
  15. Tool=Instance.new('Tool', game.Players.LocalPlayer.Backpack);
  16. Tool.GripForward=Vector3.new(-0.161, 0, -0.987);
  17. Tool.GripPos=Vector3.new(0.1, 0, 0.1);
  18. Tool.GripRight=Vector3.new(0.217, 0, -0.976);
  19. Tool.GripUp=Vector3.new(0, 1, 0);
  20. Tool.Name='Smoke Grenade'
  21. Handle=Instance.new('Part', Tool);
  22. Handle.Name = 'Handle';
  23. Handle.Size=Vector3.new(1, 1.2, 1);
  24. c4mesh=Instance.new('SpecialMesh', Handle);
  25. c4mesh.MeshType = 'FileMesh';
  26. c4mesh.MeshId='http://www.roblox.com/asset/?id=16975131';
  27. c4mesh.TextureId='http://www.roblox.com/asset/?id=16975111';
  28. c4mesh.Scale=Vector3.new(0.75, 0.75, 0.75);
  29. light=Instance.new('PointLight', Handle);
  30. light.Color = Color3.new(255,0,0)
  31. light.Range=10;
  32. light.Enabled=false;
  33. beep=Instance.new('Sound',Handle)
  34. beep.Volume=5;
  35. beep.SoundId='rbxassetid://252141949'
  36. access=Instance.new('Sound',Handle)
  37. access.Volume=5;
  38. access.SoundId='rbxassetid://131644923'
  39. beeptone=Instance.new('Sound',Handle)
  40. beeptone.Volume=5;
  41. beeptone.SoundId='rbxassetid://75338648'
  42. local Prepare=Instance.new("Animation");
  43. Prepare.AnimationId="http://www.roblox.com/Asset?ID=75322014";
  44. local Launch=Instance.new("Animation");
  45. Launch.AnimationId="http://www.roblox.com/Asset?ID=94157627";
  46. function onActivated()
  47. if not Tool.Enabled then
  48. return
  49. end
  50. Tool.Enabled=false;
  51. local LaunchAnim = humanoid:LoadAnimation(Launch);
  52. LaunchAnim:Play();
  53. wait(0.4)
  54.  
  55. local p = Handle:Clone();
  56. local dir = char.Head.CFrame.lookVector;
  57. p.Velocity = (dir * 80) + Vector3.new(0,8,0);
  58. p.CanCollide = true;
  59. p.Parent = game.Workspace;
  60. p.Name='c4';
  61. beep.Parent=p;
  62. light.Parent=p;
  63. Handle.Transparency=1;
  64.  
  65. wait(0.2)
  66. smokee=Instance.new('ParticleEmitter', p)
  67. smokee.Size = NumberSequence.new(31)
  68. smokee.Speed = NumberRange.new(10)
  69. smokee.RotSpeed = NumberRange.new(-255, 250)
  70. smokee.Texture = 'http://www.roblox.com/asset/?id=241539438'
  71. smokee.LightEmission = 1
  72. ex=Instance.new('Explosion',workspace);
  73. ex.BlastPressure=6;
  74. ex.BlastRadius=6;
  75. ex.Position=p.Position;
  76. smokee.VelocitySpread = 30
  77. smokee.Rate = 500
  78. smokee.Enabled=true;
  79. ss=Instance.new('Sound',p);
  80. ss.Volume=5;
  81. ss.SoundId='rbxassetid://424618966';
  82. ss:Play();
  83. Handle.Transparency=1;
  84. wait(16)
  85. p:remove();
  86. Handle.Transparency=0
  87. Tool.Enabled=true;
  88.  
  89.  
  90.  
  91. end
  92. Tool.Activated:connect(onActivated);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement