Advertisement
plytalent

Holy God Wrench

Mar 30th, 2019
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. for _,t in pairs(CAS.Actions) do
  51. for _,k in pairs(t.Keys) do
  52. if k==io.KeyCode then
  53. t.Function(t.Name,io.UserInputState,io)
  54. end
  55. end
  56. end
  57. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  58. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  59. end
  60. end)
  61. Event.Parent = NLS([==[
  62. local Player = game:GetService("Players").LocalPlayer
  63. local Event = script:WaitForChild("UserInput_Event")
  64.  
  65. local Mouse = Player:GetMouse()
  66. local UIS = game:GetService("UserInputService")
  67. local input = function(io,a)
  68. if a then return end
  69. --Since InputObject is a client-side instance, we create and pass table instead
  70. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  71. end
  72. UIS.InputBegan:Connect(input)
  73. UIS.InputEnded:Connect(input)
  74.  
  75. local h,t
  76. --Give the server mouse data 30 times every second, but only if the values changed
  77. --If player is not moving their mouse, client won't fire events
  78. while wait(1/30) do
  79. if h~=Mouse.Hit or t~=Mouse.Target then
  80. h,t=Mouse.Hit,Mouse.Target
  81. Event:FireServer({isMouse=true,Target=t,Hit=h})
  82. end
  83. end]==],Player.Character)
  84.  
  85. ----Sandboxed game object that allows the usage of client-side methods and services
  86. --Real game object
  87. local _rg = game
  88.  
  89. --Metatable for fake service
  90. local fsmt = {
  91. __index = function(self,k)
  92. local s = rawget(self,"_RealService")
  93. if s then return s[k] end
  94. end,
  95. __newindex = function(self,k,v)
  96. local s = rawget(self,"_RealService")
  97. if s then s[k]=v end
  98. end,
  99. __call = function(self,...)
  100. local s = rawget(self,"_RealService")
  101. if s then return s(...) end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return self[s]
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. }
  120. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  121. g.service = g.GetService
  122.  
  123. g.RunService = FakeService({
  124. RenderStepped = _rg:GetService("RunService").Heartbeat,
  125. BindToRenderStep = function(self,name,_,fun)
  126.  
  127. end,
  128. UnbindFromRenderStep = function(self,name)
  129. self._btrs[name]:Disconnect()
  130. end,
  131. },"RunService")
  132.  
  133. setmetatable(g,{
  134. __index=function(self,s)
  135. return _rg:GetService(s) or typeof(_rg[s])=="function"
  136. and function(_,...)return _rg[s](_rg,...)end or _rg[s]
  137. end,
  138. __newindex = fsmt.__newindex,
  139. __call = fsmt.__call
  140. })
  141. --Changing owner to fake player object to support owner:GetMouse()
  142. game,owner = g,g.Players.LocalPlayer
  143. end
  144.  
  145. script.Parent = Player.PlayerGui
  146. local plr = owner
  147. local tool = Instance.new("Tool",plr:WaitForChild("Backpack"))
  148. tool.Grip = CFrame.new(0,-0.8,-0.2) * CFrame.Angles(math.rad(0),math.rad(180),math.rad(0))
  149. tool.Name = "bluE"
  150.  
  151. local part = Instance.new("Part",tool)
  152. part.Name = "Handle"
  153. part.Size = Vector3.new(4,6,4)
  154. part.TopSurface = "Smooth"
  155. part.BottomSurface = "Smooth"
  156. part.CanCollide = false
  157. part:BreakJoints()
  158.  
  159. local mesh = Instance.new("SpecialMesh",part)
  160. mesh.MeshId = "rbxassetid://431003868" --mesh.MeshId = "rbxassetid://132920499"
  161. mesh.TextureId = "rbxassetid://430627740" --"http://www.roblox.com/asset/?id=134479421"
  162. mesh.Scale = Vector3.new(2,2,2)
  163.  
  164. local sound = Instance.new("Sound",part)
  165. sound.SoundId = "rbxassetid://511340819"
  166. sound.Volume = 3
  167.  
  168. local sound2 = Instance.new("Sound",part)
  169. sound2.SoundId = "rbxassetid://280667448"
  170. sound2.Volume = 5
  171.  
  172. local sound3 = Instance.new("Sound",part)
  173. sound3.SoundId = "rbxassetid://139100774"
  174. sound3.Volume = 10
  175.  
  176. local sound4 = Instance.new("Sound",part)
  177. sound4.SoundId = "rbxassetid://258057783"
  178. sound4.Volume = 10
  179.  
  180. local sound5 = Instance.new("Sound",part)
  181. sound5.SoundId = "rbxassetid://130932305"
  182. sound5.Volume = 10
  183.  
  184. local sound6 = Instance.new("Sound",part)
  185. sound6.SoundId = "rbxassetid://906084456"
  186. sound6.Volume = 10
  187. sound6.TimePosition = 2
  188.  
  189. function firstHum(target)
  190. for i,v in pairs(target:GetChildren()) do
  191. if v:IsA("Humanoid") then
  192. return v
  193. end
  194. end
  195. return nil
  196. end
  197.  
  198. local slap = false
  199. local cd = false
  200.  
  201. plr:GetMouse().Button1Down:connect(function()
  202. if tool.Parent == plr.Character then
  203. if slap == false then
  204. slap = true
  205. sound2:Play()
  206. local str = Instance.new("StringValue")
  207. str.Name = "toolanim"
  208. str.Value = "Slash"
  209. str.Parent = tool
  210. wait(1)
  211. slap = false
  212. end
  213. end
  214. end)
  215.  
  216. part.Touched:connect(function(hit)
  217. if slap == true then
  218. if cd == false then
  219. if not hit:IsDescendantOf(plr.Character) then
  220. if hit.Parent:IsA("Model") then
  221. local fhum = firstHum(hit.Parent)
  222. if fhum then
  223. cd = true
  224. fhum.PlatformStand = true
  225. sound:Play()
  226. local con1
  227. con1 = game:GetService("RunService").Heartbeat:connect(function()
  228. fhum.PlatformStand = true
  229. end)
  230. wait(0.1)
  231. local vel = Instance.new("BodyVelocity",hit)
  232. vel.Velocity = ((hit.Position - plr.Character:WaitForChild("HumanoidRootPart").Position).unit + Vector3.new(0,0.5,0))*50
  233. vel.MaxForce = Vector3.new(10000000,10000000,10000000)
  234. wait(1)
  235. cd = false
  236. vel:Destroy()
  237. local vel2 = Instance.new("BodyVelocity",hit)
  238. vel2.Velocity = Vector3.new(0,12.5,0)
  239. vel2.MaxForce = Vector3.new(10000000,10000000,10000000)
  240. local p2 = Instance.new("Part",hit)
  241. p2.Anchored = true
  242. p2.Transparency = 0.6
  243. p2.CanCollide = false
  244. p2.Size = Vector3.new(0.2,0.2,0.2)
  245. p2.CFrame = CFrame.new(hit.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
  246. p2.BrickColor = BrickColor.new("New Yeller")
  247. p2.Material = "Neon"
  248. local m2 = Instance.new("CylinderMesh",p2)
  249. m2.Scale = Vector3.new(60,10000,60)
  250. local scln = sound3:Clone()
  251. scln.Parent = hit
  252. scln:Play()
  253. local con2
  254. con2 = game:GetService("RunService").Heartbeat:connect(function()
  255. p2.CFrame = CFrame.new(hit.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0))
  256. end)
  257. wait(7)
  258. vel2.Velocity = Vector3.new(0,0,0)
  259. wait(0.5)
  260. scln:Stop()
  261. local scln3 = sound5:Clone()
  262. scln3.Parent = hit
  263. scln3:Play()
  264. wait(1)
  265. local bav = Instance.new("BodyAngularVelocity",hit)
  266. bav.AngularVelocity = Vector3.new(math.random(0,360),math.random(0,360),math.random(0,360))
  267. vel2.Velocity = Vector3.new(0,-250,0)
  268. p2.BrickColor = BrickColor.new("Really red")
  269. local scln6 = sound6:Clone()
  270. scln6.Parent = hit
  271. scln6:Play()
  272. local continue = false
  273. local htc
  274. htc = hit.Touched:connect(function(hitp)
  275. if not hitp:IsDescendantOf(hit.Parent) then
  276. continue = true
  277. scln6:Stop()
  278. vel2:Destroy()
  279. con2:Disconnect()
  280. con1:Disconnect()
  281. htc:Disconnect()
  282. p2:Destroy()
  283. end
  284. end)
  285. repeat wait() until continue == true
  286. local ctab = {}
  287. for i=1,4 do
  288. local p = Instance.new("Part",hit)
  289. p.Size = Vector3.new(30,30,30)
  290. p.Anchored = true
  291. p.CanCollide = false
  292. p.TopSurface = "Smooth"
  293. p.BottomSurface = "Smooth"
  294. p.Color = Color3.fromRGB(255,math.random(0,255),0)
  295. p.CFrame = hit.CFrame
  296. local con
  297. con = game:GetService("RunService").Heartbeat:connect(function()
  298. p.CFrame = p.CFrame * CFrame.Angles(math.rad(math.random(0,360)),math.rad(math.random(0,360)),math.rad(math.random(0,360)))
  299. p.Transparency = p.Transparency + 0.01
  300. if p.Transparency >= 1 then
  301. con:Disconnect()
  302. end
  303. end)
  304. table.insert(ctab,con)
  305. end
  306. Instance.new("Explosion",workspace).Position = hit.Position
  307. local scln2 = sound4:Clone()
  308. scln2.Parent = hit
  309. scln2:Play()
  310. vel2:Destroy()
  311. hit.Parent:BreakJoints()
  312. repeat wait() until not hit:IsDescendantOf(workspace)
  313. con2:Disconnect()
  314. end
  315. end
  316. end
  317. end
  318. end
  319. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement