sneakydodge123

hammer

Jul 6th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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,game,owner = owner,game
  4. local RealPlayer = Player
  5. do print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end
  6.  
  7. --Created with ttyyuu12345's compiler
  8. --ttyyuu12345 is not responsible for damages caused to your game
  9. --This plugin does not remove things
  10. --ttyyuu12345 cannot be held resonsible for manual deletion for the purpose of testing
  11. --Keep in mind, any items that cause errors in compilation will be skipped and documented within the last line of the disclaimer comments
  12. --Thank you for using my plugin and enjoy :)
  13. --It is free to use, however I do accept donations
  14. --Errors: TouchTransmitter
  15. Tool = Instance.new("Tool",game.Lighting)
  16. Create = function(itemClass,tabl)
  17. local item = Instance.new(itemClass)
  18. for i,v in pairs(tabl) do
  19. local a,b = ypcall(function() return item[i] end)
  20. if a then
  21. item[i] = tabl[i]
  22. end
  23. end
  24. return item
  25. end
  26. function runDummyScript(f,scri)
  27. local oldenv = getfenv(f)
  28. local newenv = setmetatable({}, {
  29. __index = function(_, k)
  30. if k:lower() == 'script' then
  31. return scri
  32. else
  33. return oldenv[k]
  34. end
  35. end
  36. })
  37. setfenv(f, newenv)
  38. ypcall(function() f() end)
  39. end
  40. cors = {}
  41. mas = Instance.new("Model",game:GetService("Lighting"))
  42. mas.Name = "CompiledModel"
  43. o1 = Create("LocalScript",{
  44. ["Name"] = "HammerScript",
  45. ["Parent"] = mas,
  46. })
  47. table.insert(cors,coroutine.create(function()
  48. wait()
  49. runDummyScript(function()
  50. -------- OMG HAX
  51.  
  52. r = game:service("RunService")
  53.  
  54.  
  55. Tool = script.Parent
  56. hammer = Tool.Handle
  57.  
  58. local shockRing = Instance.new("Part")
  59. shockRing.formFactor = 2
  60. shockRing.Size = Vector3.new(1, 0.4, 1)
  61. shockRing.Anchored = true
  62. shockRing.Locked = true
  63. shockRing.CanCollide = false
  64. shockRing.archivable = false
  65. shockRing.TopSurface = 0
  66. shockRing.BottomSurface = 0
  67. shockRing.Transparency = 1
  68. local decal = Instance.new("Decal")
  69. decal.Face = 1
  70. decal.Texture = "http://www.roblox.com/asset/?version=1&id=1280730"
  71. decal.Parent = shockRing
  72.  
  73. local bottomDecal = decal:Clone()
  74. bottomDecal.Face = 4
  75. bottomDecal.Parent = shockRing
  76.  
  77.  
  78.  
  79. function doDamage(hit)
  80. if hit.Locked==false then
  81. hit:Remove()
  82. end
  83. end
  84.  
  85.  
  86. function tagHumanoid(humanoid, player)
  87. local creator_tag = Instance.new("ObjectValue")
  88. creator_tag.Value = player
  89. creator_tag.Name = "creator"
  90. creator_tag.Parent = humanoid
  91. end
  92.  
  93. function untagHumanoid(humanoid)
  94. if humanoid ~= nil then
  95. local tag = humanoid:findFirstChild("creator")
  96. if tag ~= nil then
  97. tag.Parent = nil
  98. end
  99. end
  100. end
  101.  
  102. function blow(obj, pos, notme)
  103. if (obj ~= notme) then
  104. if (obj.className == "Part") or (obj.className == "Seat") then
  105. 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
  106. 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)
  107. end
  108. elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
  109. local list = obj:GetChildren()
  110. for x = 1, #list do
  111. blow(list[x], pos, notme)
  112. end
  113. end
  114. end
  115. end
  116.  
  117. function attack()
  118. damage = slash_damage
  119. local anim = Instance.new("StringValue")
  120. anim.Name = "toolanim"
  121. anim.Value = "Slash"
  122. anim.Parent = Tool
  123. wait(0.2)
  124.  
  125. print("Blasting!")
  126.  
  127. local pos = hammer.CFrame * (Vector3.new(0, 1.4, 0) * hammer.Mesh.Scale)
  128.  
  129. blow(workspace, pos, Tool.Parent)
  130.  
  131. shockRing.CFrame = CFrame.new(pos)
  132. for x = 1, 29 do
  133. 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)
  134. end
  135. delay(1, function() shockRing.Parent = nil end)
  136. end
  137.  
  138.  
  139. Tool.Enabled = true
  140. function onActivated()
  141.  
  142. if not Tool.Enabled then
  143. return
  144. end
  145.  
  146. Tool.Enabled = false
  147.  
  148. local character = Tool.Parent;
  149. local humanoid = character.Humanoid
  150. if humanoid == nil then
  151. print("Humanoid not found")
  152. return
  153. end
  154.  
  155. hammer.Boom:Play()
  156. attack()
  157.  
  158. wait(0.5)
  159.  
  160. Tool.Enabled = true
  161. end
  162.  
  163.  
  164. script.Parent.Activated:connect(onActivated)
  165. --script.Parent.Equipped:connect(onEquipped)
  166. end,o1)
  167. end))
  168. o2 = Create("LocalScript",{
  169. ["Name"] = "Local Gui",
  170. ["Parent"] = mas,
  171. })
  172. table.insert(cors,coroutine.create(function()
  173. wait()
  174. runDummyScript(function()
  175. --rbxsig%aoxvdm1aPjaZNWfciK/Pr0xTiQSMTYPK6DeYzUBftM3ktWksFxD/qPfCrisawJWUgizm/pahcvio8hGdfVGRiDrzgV+Eu4mePmGNQTrNP1WKW+gHElJt9nBVEWptENhA5JCXALEN65aM6HLKdEaWvEOtAKhSF2Y2nJcuyixzj58=%
  176. --rbxassetid%1014476%
  177. local Tool = script.Parent;
  178.  
  179. enabled = true
  180. function onButton1Down(mouse)
  181. if not enabled then
  182. return
  183. end
  184.  
  185. enabled = false
  186. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  187.  
  188. wait(.5)
  189. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  190. enabled = true
  191.  
  192. end
  193.  
  194. function onEquippedLocal(mouse)
  195.  
  196. if mouse == nil then
  197. print("Mouse not found")
  198. return
  199. end
  200.  
  201. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  202. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  203. end
  204.  
  205.  
  206. Tool.Equipped:connect(onEquippedLocal)
  207.  
  208. end,o2)
  209. end))
  210. o3 = Create("Part",{
  211. ["Name"] = "Handle",
  212. ["Parent"] = mas,
  213. ["BrickColor"] = BrickColor.new("Dark stone grey"),
  214. ["Position"] = Vector3.new(-8.5, 2, -19),
  215. ["CFrame"] = CFrame.new(-8.5, 2, -19, 1, 0, 0, 0, 1, 0, 0, 0, 1),
  216. ["FormFactor"] = Enum.FormFactor.Symmetric,
  217. ["Size"] = Vector3.new(1, 4, 2),
  218. ["BottomSurface"] = Enum.SurfaceType.Smooth,
  219. ["TopSurface"] = Enum.SurfaceType.Smooth,
  220. ["Color"] = Color3.new(0.388235, 0.372549, 0.384314),
  221. })
  222. o4 = Create("SpecialMesh",{
  223. ["Parent"] = o3,
  224. ["MeshId"] = "http://www.roblox.com/asset/?id=1279013",
  225. ["Scale"] = Vector3.new(1.04999995, 1.04999995, 1.04999995),
  226. ["TextureId"] = "http://www.roblox.com/asset/?id=1279012",
  227. ["MeshType"] = Enum.MeshType.FileMesh,
  228. })
  229. o5 = Create("Sound",{
  230. ["Name"] = "Boom",
  231. ["Parent"] = o3,
  232. ["SoundId"] = "rbxasset://sounds/Rocket shot.wav",
  233. ["Volume"] = 1,
  234. })
  235. mas.Parent = workspace
  236. mas:MakeJoints()
  237. local mas1 = mas:GetChildren()
  238. for i=1,#mas1 do
  239. mas1[i].Parent = Tool
  240. ypcall(function() mas1[i]:MakeJoints() end)
  241. end
  242. mas:Destroy()
  243. Tool.Parent = game.Players.LocalPlayer.Character
  244. script.Parent = Tool
  245. for i=1,#cors do
  246. coroutine.resume(cors[i])
  247. end
Add Comment
Please, Sign In to add comment