Advertisement
lafur

Untitled

Sep 16th, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.97 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 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. Script1 = Instance.new("Script")
  23. LocalScript2 = Instance.new("LocalScript")
  24. RemoteEvent3 = Instance.new("RemoteEvent")
  25. Part4 = Instance.new("Part")
  26. Script5 = Instance.new("Script")
  27. Script6 = Instance.new("Script")
  28. Script7 = Instance.new("Script")
  29. Sound8 = Instance.new("Sound")
  30. Sound8.Name = "Sound2"
  31. killsound = Instance.new("Sound")
  32. Script9 = Instance.new("Script")
  33. LocalScript10 = Instance.new("LocalScript")
  34. Tool0.Name = "Heavy Barrel"
  35. Tool0.Parent = mas
  36. Script1.Parent = Tool0
  37. table.insert(cors,sandbox(Script1,function()
  38. --[[
  39. Rewritten by ArceusInator
  40. - Completely rewrote the sword
  41. - Added a Configurations folder so damage settings can be easily modified
  42. - The sword runs on the client in non-FE to reduce the impression of input delay
  43. - Fixed the floaty lunge issue
  44.  
  45. This script will run the sword code on the server if filtering is enabled
  46. --]]
  47. local Tool = script.Parent
  48. local GLib = require(206209239)
  49. local GLibScript = GLib.Script
  50. GLibScript.Name = 'GLib'
  51. GLibScript.Parent = Tool
  52. local Sword = require(Tool:WaitForChild'Sword')
  53.  
  54. if workspace.FilteringEnabled then
  55. -- Run the sword code on the server and accept input from the client
  56.  
  57. Sword:Initialize()
  58.  
  59. Tool:WaitForChild'RemoteClick'.OnServerEvent:connect(function(client, action)
  60. if client.Character == Tool.Parent then
  61. Sword:Attack()
  62. end
  63. end)
  64. end
  65. Tool.Unequipped:connect(function()
  66. Sword:Unequip()
  67. end)
  68. end))
  69. LocalScript2.Parent = Tool0
  70. table.insert(cors,sandbox(LocalScript2,function()
  71. --[[
  72. Rewritten by ArceusInator
  73.  
  74. This script will run the sword code on the client if filtering is disabled
  75. --]]
  76. local Tool = script.Parent
  77. local Sword = require(Tool:WaitForChild'Sword')
  78. local GLib = require(Tool:WaitForChild'GLib')
  79.  
  80. if not workspace.FilteringEnabled then
  81. -- Run the sword code on the client
  82.  
  83. Sword:Initialize()
  84. end
  85.  
  86. Tool.Equipped:connect(function(mouse)
  87. Tool.Handle.UnsheathSound:Play()
  88.  
  89. mouse.Button1Down:connect(function()
  90. GLib.FastSpawn(function() Sword:LocalAttack() end)
  91.  
  92. if workspace.FilteringEnabled then
  93. -- Send input info to the server
  94. Tool.RemoteClick:FireServer()
  95. else
  96. -- Interpret it on the client
  97. Sword:Attack()
  98. end
  99. end)
  100. end)
  101. Tool.Unequipped:connect(function()
  102. Sword:Unequip()
  103. end)
  104. end))
  105. RemoteEvent3.Name = "RemoteClick"
  106. RemoteEvent3.Parent = Tool0
  107. Part4.Name = "Handle"
  108. Part4.Parent = Tool0
  109. Part4.Material = Enum.Material.CorrodedMetal
  110. Part4.BrickColor = BrickColor.new("Dark stone grey")
  111. Part4.Size = Vector3.new(2.5, 3.5, 2.5)
  112. Part4.CFrame = CFrame.new(182.000046, 9.10001373, 229.699982, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  113. Part4.BottomSurface = Enum.SurfaceType.Smooth
  114. Part4.TopSurface = Enum.SurfaceType.Smooth
  115. Part4.Color = Color3.new(0.458824, 0, 0)
  116. Part4.Shape = 2
  117. Part4.Position = Vector3.new(182.000046, 9.10001373, 229.699982)
  118. Part4.Color = Color3.new(0.458824, 0, 0)
  119. Script5.Name = "HatShot"
  120. Script5.Parent = Part4
  121. table.insert(cors,sandbox(Script5,function()
  122. function RemoveHat(hit)
  123. local name = hit.Parent.className
  124. if (name == "Hat") then
  125. local human = hit.Parent.Parent:findFirstChild("Humanoid")
  126. if (human ~= nil) then
  127. hit.Parent:remove()
  128. end
  129. end
  130. end
  131.  
  132. connection = script.Parent.Touched:connect(RemoveHat)
  133.  
  134. end))
  135. Script6.Name = "HeadShot"
  136. Script6.Parent = Part4
  137. table.insert(cors,sandbox(Script6,function()
  138. function blood(hit)
  139. local name = hit.Name
  140. if (name == "Head") then
  141. local human = hit.Parent:findFirstChild("Humanoid") or hit.Parent:findFirstChild("Zombie") or hit.Parent:findFirstChild("Alien")
  142. if (human ~= nil) then
  143. local h = hit.Parent:findFirstChild("Head")
  144. local t = hit.Parent:findFirstChild("Torso")
  145. local b = hit.Parent:findFirstChild("Humanoid")
  146. if (h ~= nil) and (t ~= nil) then
  147. local x = h.Position.x
  148. local y = h.Position.y
  149. local z = h.Position.z
  150. local x1 = x + 1
  151. local y1 = y + 1
  152. local z1 = z + 1
  153. local x2 = x - 1
  154. local y2 = y - 1
  155. local z2 = z - 1
  156. local b1 = Instance.new("Part")
  157. b1.Parent = h.Parent
  158. b1.BrickColor = BrickColor.new("Crimson")
  159. b1.formFactor = 2
  160. b1.Name = "Part"
  161. b1.Size = Vector3.new(1, 0., 1)
  162. b1.Position = Vector3.new(x, y1, z)
  163. b1.Locked = true
  164. local b2 = Instance.new("Part")
  165. b2.Parent = h.Parent
  166. b2.BrickColor = BrickColor.new("Crimson")
  167. b2.formFactor = 2
  168. b2.Name = "Part"
  169. b2.Size = Vector3.new(1, 0.05, 1)
  170. b2.Position = Vector3.new(x1, y, z)
  171. b2.Locked = true
  172. local b3 = Instance.new("Part")
  173. b3.Parent = h.Parent
  174. b3.BrickColor = BrickColor.new("Crimson")
  175. b3.formFactor = 2
  176. b3.Name = "Part"
  177. b3.Size = Vector3.new(1, 0.05, 1)
  178. b3.Position = Vector3.new(x, y, z1)
  179. b3.Locked = true
  180. local b4 = Instance.new("Part")
  181. b4.Parent = h.Parent
  182. b4.BrickColor = BrickColor.new("Crimson")
  183. b4.formFactor = 2
  184. b4.Name = "Part"
  185. b4.Size = Vector3.new(1, 0.05, 1)
  186. b4.Position = Vector3.new(x, y2, z)
  187. b4.Locked = true
  188. local b5 = Instance.new("Part")
  189. b5.Parent = h.Parent
  190. b5.BrickColor = BrickColor.new("Crimson")
  191. b5.formFactor = 2
  192. b5.Name = "Part"
  193. b5.Size = Vector3.new(1, 0.05, 1)
  194. b5.Position = Vector3.new(x2, y, z)
  195. b5.Locked = true
  196. local b6 = Instance.new("Part")
  197. b6.Parent = h.Parent
  198. b6.BrickColor = BrickColor.new("Crimson")
  199. b6.formFactor = 2
  200. b6.Name = "Part"
  201. b6.Size = Vector3.new(1, 0.05, 1)
  202. b6.Position = Vector3.new(x, y, z2)
  203. b6.Locked = true
  204. local b1a = Instance.new("Part")
  205. b1a.Parent = h.Parent
  206. b1a.BrickColor = BrickColor.new("Crimson")
  207. b1a.formFactor = 2
  208. b1a.Name = "Part"
  209. b1a.Size = Vector3.new(1, 0., 1)
  210. b1a.Position = Vector3.new(x, y1 + 1, z)
  211. b1a.Locked = true
  212. local b2a = Instance.new("Part")
  213. b2a.Parent = h.Parent
  214. b2a.BrickColor = BrickColor.new("Crimson")
  215. b2a.formFactor = 2
  216. b2a.Name = "Part"
  217. b2a.Size = Vector3.new(1, 0.05, 1)
  218. b2a.Position = Vector3.new(x1, y + 1, z)
  219. b2a.Locked = true
  220. local b3a = Instance.new("Part")
  221. b3a.Parent = h.Parent
  222. b3a.BrickColor = BrickColor.new("Crimson")
  223. b3a.formFactor = 2
  224. b3a.Name = "Part"
  225. b3a.Size = Vector3.new(1, 0.05, 1)
  226. b3a.Position = Vector3.new(x, y + 1, z1)
  227. b3a.Locked = true
  228. local b4a = Instance.new("Part")
  229. b4a.Parent = h.Parent
  230. b4a.BrickColor = BrickColor.new("Crimson")
  231. b4a.formFactor = 2
  232. b4a.Name = "Part"
  233. b4a.Size = Vector3.new(1, 0.05, 1)
  234. b4a.Position = Vector3.new(x, y2 + 1, z)
  235. b4a.Locked = true
  236. local b5a = Instance.new("Part")
  237. b5a.Parent = h.Parent
  238. b5a.BrickColor = BrickColor.new("Crimson")
  239. b5a.formFactor = 2
  240. b5a.Name = "Part"
  241. b5a.Size = Vector3.new(1, 0.05, 1)
  242. b5a.Position = Vector3.new(x2, y + 1, z)
  243. b5a.Locked = true
  244. local b6a = Instance.new("Part")
  245. b6a.Parent = h.Parent
  246. b6a.BrickColor = BrickColor.new("Crimson")
  247. b6a.formFactor = 2
  248. b6a.Name = "Part"
  249. b6a.Size = Vector3.new(1, 0.05, 1)
  250. b6a.Position = Vector3.new(x, y + 1, z2)
  251. b6a.Locked = true
  252. h:remove()
  253. local bd1 = Instance.new("Decal")
  254. bd1.Parent = t
  255. bd1.Name = "Blood"
  256. bd1.Texture = "http://www.roblox.com/asset/?id=2520255"
  257. bd1.Face = 0
  258. local bd2 = Instance.new("Decal")
  259. bd2.Parent = t
  260. bd2.Name = "Blood"
  261. bd2.Texture = "http://www.roblox.com/asset/?id=2520270"
  262. bd2.Face = 1
  263. local bd3 = Instance.new("Decal")
  264. bd3.Parent = t
  265. bd3.Name = "Blood"
  266. bd3.Texture = "http://www.roblox.com/asset/?id=2520255"
  267. bd3.Face = 2
  268. local bd4 = Instance.new("Decal")
  269. bd4.Parent = t
  270. bd4.Name = "Blood"
  271. bd4.Texture = "http://www.roblox.com/asset/?id=2520255"
  272. bd4.Face = 3
  273. local bd5 = Instance.new("Decal")
  274. bd5.Parent = t
  275. bd5.Name = "Blood"
  276. bd5.Texture = "http://www.roblox.com/asset/?id=2520270"
  277. bd5.Face = 4
  278. local bd6 = Instance.new("Decal")
  279. bd6.Parent = t
  280. bd6.Name = "Blood"
  281. bd6.Texture = "http://www.roblox.com/asset/?id=2520255"
  282. bd6.Face = 5
  283. end
  284. end
  285. end
  286. end
  287.  
  288. connection = script.Parent.Touched:connect(blood)
  289.  
  290. end))
  291. Script7.Parent = Part4
  292. table.insert(cors,sandbox(Script7,function()
  293. function touch()
  294.  
  295. script.Parent.Sound:Play()
  296. script.Parent.Sound2:Play()
  297. wait(3)
  298.  
  299. end
  300. script.Parent.Touched:connect(touch)
  301.  
  302. end))
  303. Sound8.Parent = Part4
  304. Sound8.Pitch = 0.75
  305. Sound8.SoundId = "rbxassetid://429400881"
  306. Sound8.Volume = 0.5
  307. killsound.SoundId = "http://www.roblox.com/asset?id=418658161"
  308. killsound.Pitch = 0.85
  309. killsound.TimePosition = 3
  310. killsound.Parent = Part4
  311. Script9.Name = "SpeedBoostScript"
  312. Script9.Parent = Tool0
  313. Script9.Disabled = true
  314. table.insert(cors,sandbox(Script9,function()
  315. --Made by Stickmasterluke
  316.  
  317.  
  318. sp=script.Parent
  319.  
  320. speedboost=1 --100% speed bonus
  321. speedforsmoke=10 --smoke apears when character running >= 10 studs/second.
  322.  
  323. function waitfor(a,b,c)
  324. local c=c or 5*60
  325. local d=tick()+c
  326. while a:FindFirstChild(b)==nil and tick()<=d do
  327. wait()
  328. end
  329. return a:FindFirstChild(b)
  330. end
  331.  
  332. local tooltag=waitfor(script,"ToolTag",2)
  333. if tooltag~=nil then
  334. local tool=tooltag.Value
  335. local h=sp:FindFirstChild("Humanoid")
  336. if h~=nil then
  337. h.WalkSpeed=16+64*speedboost
  338. local t=sp:FindFirstChild("Torso")
  339. if t~=nil then
  340. smokepart=Instance.new("Part")
  341. smokepart.FormFactor="Custom"
  342. smokepart.Size=Vector3.new(0,0,0)
  343. smokepart.TopSurface="Smooth"
  344. smokepart.BottomSurface="Smooth"
  345. smokepart.CanCollide=false
  346. smokepart.Transparency=1
  347. local weld=Instance.new("Weld")
  348. weld.Name="SmokePartWeld"
  349. weld.Part0=t
  350. weld.Part1=smokepart
  351. weld.C0=CFrame.new(0,-3.5,0)*CFrame.Angles(math.pi/4,0,0)
  352. weld.Parent=smokepart
  353. smokepart.Parent=sp
  354. smoke=Instance.new("Smoke")
  355. smoke.Enabled=t.Velocity.magnitude>speedforsmoke
  356. smoke.RiseVelocity=2
  357. smoke.Opacity=.25
  358. smoke.Size=.5
  359. smoke.Parent=smokepart
  360. h.Running:connect(function(speed)
  361. if smoke and smoke~=nil then
  362. smoke.Enabled=speed>speedforsmoke
  363. end
  364. end)
  365. end
  366. end
  367. while tool~=nil and tool.Parent==sp and h~=nil do
  368. sp.ChildRemoved:wait()
  369. end
  370. local h=sp:FindFirstChild("Humanoid")
  371. if h~=nil then
  372. h.WalkSpeed=16
  373. end
  374. end
  375.  
  376. if smokepart~=nil then
  377. smokepart:remove()
  378. end
  379. script:remove()
  380.  
  381.  
  382.  
  383. end))
  384. LocalScript10.Parent = Tool0
  385. table.insert(cors,sandbox(LocalScript10,function()
  386. --Made by Stickmasterluke
  387.  
  388.  
  389. sp=script.Parent
  390.  
  391.  
  392. function waitfor(a,b)
  393. while a:FindFirstChild(b)==nil do
  394. a.ChildAdded:wait()
  395. end
  396. return a:FindFirstChild(b)
  397. end
  398.  
  399. speedboostscript=waitfor(sp,"SpeedBoostScript")
  400.  
  401. function Equipped()
  402. if sp.Parent:FindFirstChild("SpeedBoostScript")==nil then
  403. local s=speedboostscript:clone()
  404. local tooltag=Instance.new("ObjectValue")
  405. tooltag.Name="ToolTag"
  406. tooltag.Value=sp
  407. tooltag.Parent=s
  408. s.Parent=sp.Parent
  409. s.Disabled=false
  410. local sound=sp.Handle:FindFirstChild("CoilSound")
  411. if sound~=nil then
  412. sound:Play()
  413. end
  414. end
  415. end
  416.  
  417. sp.Equipped:connect(Equipped)
  418.  
  419. end))
  420. for i,v in pairs(mas:GetChildren()) do
  421. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  422. pcall(function() v:MakeJoints() end)
  423. end
  424. mas:Destroy()
  425. for i,v in pairs(cors) do
  426. spawn(function()
  427. pcall(v)
  428. end)
  429. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement