Advertisement
lafur

Untitled

Sep 20th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.41 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 --Converted with ttyyuu12345's model to script plugin v4
  6. function sandbox(var,func)
  7. local env = getfenv(func)
  8. local newenv = setmetatable({},{
  9. __index = function(self,k)
  10. if k=="script" then
  11. return var
  12. else
  13. return env[k]
  14. end
  15. end,
  16. })
  17. setfenv(func,newenv)
  18. return func
  19. end
  20. cors = {}
  21. mas = Instance.new("Model",game:GetService("Lighting"))
  22. Tool0 = Instance.new("Tool")
  23. Part1 = Instance.new("Part")
  24. Sound2 = Instance.new("Sound")
  25. SpecialMesh3 = Instance.new("SpecialMesh")
  26. ParticleEmitter4 = Instance.new("ParticleEmitter")
  27. PointLight5 = Instance.new("PointLight")
  28. Script6 = Instance.new("Script")
  29. LocalScript7 = Instance.new("LocalScript")
  30. Script8 = Instance.new("Script")
  31. PointLight9 = Instance.new("PointLight")
  32. Tool0.Name = "BanHammer"
  33. Tool0.Parent = mas
  34. Tool0.GripPos = Vector3.new(0, -1, 0)
  35. Part1.Name = "Handle"
  36. Part1.Parent = Tool0
  37. Part1.Rotation = Vector3.new(90.0199966, 0, 66.4599991)
  38. Part1.RotVelocity = Vector3.new(-0.00235919608, 0.000430068758, 0.00397496484)
  39. Part1.Velocity = Vector3.new(0.00131022232, -0.00751958555, 0.00376307126)
  40. Part1.Size = Vector3.new(1, 4.80000019, 1)
  41. Part1.CFrame = CFrame.new(32.008461, 0.891610622, -25.8348217, 0.39936024, -0.916794062, -5.90707568e-05, -0.00029530219, -6.41899824e-05, -0.99999994, 0.916794002, 0.39936021, -0.000296359474)
  42. Part1.Position = Vector3.new(32.008461, 0.891610622, -25.8348217)
  43. Part1.Orientation = Vector3.new(89.9799957, -168.729996, -102.259995)
  44. Sound2.Name = "Boom"
  45. Sound2.Parent = Part1
  46. Sound2.SoundId = "rbxasset://sounds/Rocket shot.wav"
  47. Sound2.Volume = 1
  48. SpecialMesh3.Parent = Part1
  49. SpecialMesh3.MeshId = "rbxassetid://10604848"
  50. SpecialMesh3.TextureId = "rbxassetid://94840359"
  51. SpecialMesh3.MeshType = Enum.MeshType.FileMesh
  52. ParticleEmitter4.Parent = Part1
  53. ParticleEmitter4.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
  54. ParticleEmitter4.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
  55. PointLight5.Parent = Part1
  56. PointLight5.Color = Color3.new(1, 0, 0.0156863)
  57. PointLight5.Brightness = 9.9999998430675e+17
  58. PointLight5.Range = 60
  59. PointLight5.Color = Color3.new(1, 0, 0.0156863)
  60. Script6.Name = "HammerScript"
  61. Script6.Parent = Tool0
  62. table.insert(cors,sandbox(Script6,function()
  63. -------- OMG HAX
  64.  
  65. r = game:service("RunService")
  66.  
  67.  
  68. Tool = script.Parent
  69. hammer = Tool.Handle
  70.  
  71. local shockRing = Instance.new("Part")
  72. shockRing.formFactor = 2
  73. shockRing.Size = Vector3.new(1, 0.60, 999999)
  74. shockRing.Anchored = true
  75. shockRing.Locked = true
  76. shockRing.CanCollide = false
  77. shockRing.archivable = false
  78. shockRing.TopSurface = 0
  79. shockRing.BottomSurface = 0
  80. shockRing.Transparency = 1
  81. local decal = Instance.new("Decal")
  82. decal.Face = 1
  83. decal.Texture = "http://www.roblox.com/asset/?version=1&id=1280730"
  84. decal.Parent = shockRing
  85.  
  86. local bottomDecal = decal:Clone()
  87. bottomDecal.Face = 4
  88. bottomDecal.Parent = shockRing
  89.  
  90.  
  91.  
  92. function doDamage(hit)
  93. local humanoid = hit.Parent:findFirstChild("Humanoid")
  94. local vCharacter = Tool.Parent
  95. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  96. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  97. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  98. tagHumanoid(humanoid, vPlayer)
  99. humanoid:TakeDamage(humanoid.MaxHealth)
  100. if humanoid.Health <= 0 then
  101. local c = hit.CFrame
  102. hit.CFrame = CFrame.new(hit.Position)
  103. hit.CFrame = c
  104. end
  105. delay(1, function() untagHumanoid(humanoid) end)
  106. else
  107. local c = hit.CFrame hit:BreakJoints() hit.CFrame = CFrame.new(hit.Position) hit.CFrame = c
  108. end
  109. end
  110.  
  111.  
  112. function tagHumanoid(humanoid, player)
  113. local creator_tag = Instance.new("ObjectValue")
  114. creator_tag.Value = player
  115. creator_tag.Name = "creator"
  116. creator_tag.Parent = humanoid
  117. end
  118.  
  119. function untagHumanoid(humanoid)
  120. if humanoid ~= nil then
  121. local tag = humanoid:findFirstChild("creator")
  122. if tag ~= nil then
  123. tag.Parent = nil
  124. end
  125. end
  126. end
  127.  
  128. function blow(obj, pos, notme)
  129. if (obj ~= notme) then
  130. if (obj.className == "Part") or (obj.className == "Seat") then
  131. if (not obj.Anchored) and (((pos - obj.Position) * Vector3.new(1, 0, 1)).magnitude < 96) and (pos.y <= obj.Position.y + 8) and (pos.y >= obj.Position.y - 8) then
  132. delay((pos - obj.Position).magnitude / 96, function() doDamage(obj) obj.Velocity = ((obj.Position - pos).unit + Vector3.new(0, 0.5, 0)) * 96 + obj.Velocity obj.RotVelocity = obj.RotVelocity + Vector3.new(obj.Position.z - pos.z, 0, pos.x - obj.Position.x).unit * 40 end)
  133. end
  134. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  135. local list = obj:GetChildren()
  136. for x = 1, #list do
  137. blow(list[x], pos, notme)
  138. end
  139. end
  140. end
  141. end
  142.  
  143. function attack()
  144. damage = slash_damage
  145. local anim = Instance.new("StringValue")
  146. anim.Name = "toolanim"
  147. anim.Value = "Slash"
  148. anim.Parent = Tool
  149. wait(0.2)
  150.  
  151. print("Blasting!")
  152.  
  153. local pos = hammer.CFrame * (Vector3.new(0, 1.4, 0) * hammer.Mesh.Scale)
  154.  
  155. blow(workspace, pos, Tool.Parent)
  156.  
  157. shockRing.CFrame = CFrame.new(pos)
  158. for x = 1, 29 do
  159. delay(x / 30, function() shockRing.Parent = nil shockRing.Size = Vector3.new(0, 0.4, 0) + Vector3.new(6.4, 0, 6.4) * x shockRing.Parent = Tool end)
  160. end
  161. delay(1, function() shockRing.Parent = nil end)
  162. end
  163.  
  164.  
  165. Tool.Enabled = true
  166. function onActivated()
  167.  
  168. if not Tool.Enabled then
  169. return
  170. end
  171.  
  172. Tool.Enabled = false
  173.  
  174. local character = Tool.Parent;
  175. local humanoid = character.Humanoid
  176. if humanoid == nil then
  177. print("Humanoid not found")
  178. return
  179. end
  180.  
  181. hammer.Boom:Play()
  182. attack()
  183.  
  184. wait(0.5)
  185.  
  186. Tool.Enabled = true
  187. end
  188.  
  189.  
  190. script.Parent.Activated:connect(onActivated)
  191. --script.Parent.Equipped:connect(onEquipped)
  192. end))
  193. LocalScript7.Name = "Local Gui"
  194. LocalScript7.Parent = Tool0
  195. Script8.Name = "PUT THIS IN THE WEAPON"
  196. Script8.Parent = Tool0
  197. table.insert(cors,sandbox(Script8,function()
  198. local debounce = false
  199.  
  200. function getPlayer(humanoid)
  201. local players = game.Players:children()
  202. for i = 1, #players do
  203. if players[i].Character.Humanoid == humanoid then return players[i] end
  204. end
  205. return nil
  206. end
  207.  
  208. function onTouch(part)
  209.  
  210. local human = part.Parent:findFirstChild("Humanoid")
  211. if (human ~= nil) and debounce == false then
  212.  
  213. debounce = true
  214.  
  215. local player = getPlayer(human)
  216.  
  217. if (player == nil) then return end
  218.  
  219. script.Parent:clone().Parent = player.Backpack
  220.  
  221. wait(2)
  222. debounce = false
  223. end
  224. end
  225.  
  226.  
  227. script.Parent.Parent.Touched:connect(onTouch)
  228.  
  229. end))
  230. PointLight9.Parent = Tool0
  231. PointLight9.Color = Color3.new(0.666667, 0, 1)
  232. PointLight9.Brightness = 9.9999996802857e+37
  233. PointLight9.Range = 60
  234. PointLight9.Color = Color3.new(0.666667, 0, 1)
  235. for i,v in pairs(mas:GetChildren()) do
  236. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  237. pcall(function() v:MakeJoints() end)
  238. end
  239. mas:Destroy()
  240. for i,v in pairs(cors) do
  241. spawn(function()
  242. pcall(v)
  243. end)
  244. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement