Advertisement
zXzGamePROzXz

Untitled

Dec 30th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.10 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  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,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. 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
  6.  
  7. me = game.Players.LocalPlayer
  8.  
  9.  
  10.  
  11. if script.Parent.className ~= "HopperBin" then
  12.  
  13. h = Instance.new("HopperBin")
  14.  
  15. h.Parent = me.Backpack
  16.  
  17. h.Name = "lolwut"
  18.  
  19. script.Parent = h
  20.  
  21. end
  22.  
  23.  
  24.  
  25. sp = script.Parent
  26.  
  27.  
  28.  
  29. rightarm = me.Character["Right Arm"]
  30.  
  31. leftarm = me.Character["Left Arm"]
  32.  
  33.  
  34.  
  35. hold = false
  36.  
  37. using = false
  38.  
  39. holdkey = false
  40.  
  41.  
  42.  
  43. right = Instance.new("Weld")
  44.  
  45. right.Parent = me.Character.Torso
  46.  
  47. right.Part0 = nil
  48.  
  49. right.Part1 = nil
  50.  
  51. right.C1 = CFrame.fromEulerAnglesXYZ(-1.57,-0.4,0) * CFrame.new(-1,-0.5,0.1)
  52.  
  53.  
  54.  
  55. left = Instance.new("Weld")
  56.  
  57. left.Parent = me.Character.Torso
  58.  
  59. left.Part0 = nil
  60.  
  61. left.Part1 = nil
  62.  
  63. left.C1 = CFrame.fromEulerAnglesXYZ(-1.4,0.5,0) * CFrame.new(0.55,-0.4,1.3)
  64.  
  65.  
  66.  
  67. bulletcolors = {"Bright yellow", "Neon orange", "New Yeller"}
  68.  
  69.  
  70.  
  71. gun = Instance.new("Model")
  72.  
  73. gun.Parent = game.Lighting
  74.  
  75. gun.Name = "Gun"
  76.  
  77.  
  78.  
  79. handle = Instance.new("Part")
  80.  
  81. handle.Parent = gun
  82.  
  83. handle.formFactor = 0
  84.  
  85. handle.Size = Vector3.new(1,1,1)
  86.  
  87. handle.BrickColor = BrickColor.new("Black")
  88.  
  89. mesh = Instance.new("SpecialMesh")
  90.  
  91. mesh.Parent = handle
  92.  
  93. mesh.MeshType = "Brick"
  94.  
  95. mesh.Scale = Vector3.new(0.5,0.75,1.3)
  96.  
  97.  
  98.  
  99. handle2 = Instance.new("Part")
  100.  
  101. handle2.Parent = gun
  102.  
  103. handle2.formFactor = 0
  104.  
  105. handle2.Size = Vector3.new(1,1,1)
  106.  
  107. handle2.BrickColor = BrickColor.new("Black")
  108.  
  109. mesh2 = mesh:clone()
  110.  
  111. mesh2.Parent = handle2
  112.  
  113. mesh2.Scale = Vector3.new(0.6,3.6,0.75)
  114.  
  115.  
  116.  
  117. handle3 = Instance.new("Part")
  118.  
  119. handle3.Parent = gun
  120.  
  121. handle3.formFactor = 0
  122.  
  123. handle3.Size = Vector3.new(1,1,1)
  124.  
  125. handle3.BrickColor = BrickColor.new("Black")
  126.  
  127. mesh3 = mesh:clone()
  128.  
  129. mesh3.Parent = handle3
  130.  
  131. mesh3.Scale = Vector3.new(0.45,0.8,1.4)
  132.  
  133.  
  134.  
  135. handle4 = Instance.new("Part")
  136.  
  137. handle4.Parent = gun
  138.  
  139. handle4.formFactor = 0
  140.  
  141. handle4.Size = Vector3.new(1,1,1)
  142.  
  143. handle4.BrickColor = BrickColor.new("Really black")
  144.  
  145. mesh4 = Instance.new("CylinderMesh")
  146.  
  147. mesh4.Parent = handle4
  148.  
  149. mesh4.Scale = Vector3.new(0.3,0.1,0.3)
  150.  
  151. hold = false
  152.  
  153. function selected(mouse, key)
  154.  
  155. right.Part0 = right.Parent
  156.  
  157. right.Part1 = rightarm
  158.  
  159. left.Part0 = left.Parent
  160.  
  161. left.Part1 = leftarm
  162.  
  163. left.C1 = CFrame.fromEulerAnglesXYZ(-1.4,0.5,0) * CFrame.new(0.55,-0.4,1.3)
  164.  
  165. right.C1 = CFrame.fromEulerAnglesXYZ(-1.57,-0.4,0) * CFrame.new(-1,-0.5,0.1)
  166.  
  167. left.C0 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,0,0)
  168.  
  169. right.C0 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,0,0)
  170.  
  171. gun.Parent = me.Character
  172.  
  173. gunweld1 = Instance.new("Weld")
  174.  
  175. gunweld1.Parent = rightarm
  176.  
  177. gunweld1.Part0 = gunweld1.Parent
  178.  
  179. gunweld1.Part1 = handle
  180.  
  181. gunweld1.C1 = CFrame.fromEulerAnglesXYZ(0.4,0,0) * CFrame.new(0,1,0)
  182.  
  183. gunweld2 = Instance.new("Weld")
  184.  
  185. gunweld2.Parent = handle
  186.  
  187. gunweld2.Part0 = gunweld2.Parent
  188.  
  189. gunweld2.Part1 = handle2
  190.  
  191. gunweld2.C1 = CFrame.fromEulerAnglesXYZ(-0.4,0,0) * CFrame.new(0,1,1.2)
  192.  
  193. gunweld3 = Instance.new("Weld")
  194.  
  195. gunweld3.Parent = handle2
  196.  
  197. gunweld3.Part0 = gunweld3.Parent
  198.  
  199. gunweld3.Part1 = handle3
  200.  
  201. gunweld3.C1 = CFrame.fromEulerAnglesXYZ(-0.3,0,0) * CFrame.new(0,0.3,-0.9)
  202.  
  203. gunweld4 = Instance.new("Weld")
  204.  
  205. gunweld4.Parent = handle2
  206.  
  207. gunweld4.Part0 = gunweld3.Parent
  208.  
  209. gunweld4.Part1 = handle4
  210.  
  211. gunweld4.C1 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,1.751,0)
  212.  
  213. mouse.Button1Down:connect(function()
  214.  
  215. hold = true
  216.  
  217. while hold == true do
  218.  
  219. wait(0.04)
  220.  
  221. local color = math.random(1, #bulletcolors)
  222.  
  223. local pos = mouse.Hit.p + Vector3.new(math.random(-2,2),0,math.random(-2,2))
  224.  
  225. local bullet = Instance.new("Part")
  226.  
  227. bullet.Parent = workspace
  228.  
  229. bullet.formFactor = 0
  230.  
  231. bullet.Size = Vector3.new(1,1,1)
  232.  
  233. bullet.BrickColor = BrickColor.new(bulletcolors[color])
  234.  
  235. bullet.CanCollide = false
  236.  
  237. bullet.Anchored = true
  238.  
  239. bullet.CFrame = CFrame.new((handle4.Position + pos)/2, pos)
  240.  
  241. local distance = (handle4.Position - pos).magnitude
  242.  
  243. local bulletmesh = Instance.new("SpecialMesh")
  244.  
  245. bulletmesh.Parent = bullet
  246.  
  247. bulletmesh.MeshType = "Brick"
  248.  
  249. bulletmesh.Scale = Vector3.new(0.2,0.2,distance)
  250.  
  251. if mouse.Target ~= nil then
  252.  
  253. local hu = mouse.Target.Parent:findFirstChild("Humanoid")
  254.  
  255. if hu ~= nil then
  256.  
  257. hu.Health = hu.Health - 5
  258.  
  259. end
  260.  
  261. end
  262.  
  263. coroutine.resume(coroutine.create(function()
  264.  
  265. left.C0 = left.C0 * CFrame.fromEulerAnglesXYZ(0.12,0,0)
  266.  
  267. right.C0 = right.C0 * CFrame.fromEulerAnglesXYZ(0.12,0,0)
  268.  
  269. wait()
  270.  
  271. left.C0 = left.C0 * CFrame.fromEulerAnglesXYZ(-0.12,0,0)
  272.  
  273. right.C0 = right.C0 * CFrame.fromEulerAnglesXYZ(-0.12,0,0)
  274.  
  275. wait(0.03)
  276.  
  277. bullet:remove()
  278.  
  279. end))
  280.  
  281. end
  282.  
  283. end)
  284.  
  285. mouse.Button1Up:connect(function()
  286.  
  287. hold = false
  288.  
  289. end)
  290.  
  291. end
  292.  
  293.  
  294.  
  295. function deselect()
  296.  
  297. left.C0 = CFrame.new(0,0,0)
  298.  
  299. right.C0 = CFrame.new(0,0,0)
  300.  
  301. me.Character:makeJoints()
  302.  
  303. wait()
  304.  
  305. right.Part0 = nil
  306.  
  307. right.Part1 = nil
  308.  
  309. left.Part0 = nil
  310.  
  311. left.Part1 = nil
  312.  
  313. gun.Parent = game.Lighting
  314.  
  315. me.Character:makeJoints()
  316.  
  317. end
  318.  
  319.  
  320.  
  321. sp.Selected:connect(selected)
  322.  
  323. sp.Deselected:connect(deselect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement