kaualima12

Untitled

Oct 26th, 2019
248
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
  6. print("FE Compatibility code V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152.  
  153. wait(0.2)
  154. -- Services --
  155. local Player = game:GetService("Players").LocalPlayer
  156. local RunService = game:GetService("RunService")
  157. local InputService = game:GetService("UserInputService")
  158. local ChatService = game:GetService("Chat")
  159. local Mouse = Player:GetMouse()
  160. -- Variables --
  161. local Character = Player.Character
  162. local Torso = Character.Torso
  163. local Head = Character.Head
  164. local HammerHandleWeld = Character.HumanoidRootPart
  165. local Humanoid = Character:FindFirstChild("Humanoid")
  166. local Parts = Instance.new("Model",Character)
  167. local clickDebounce = false
  168. local hitBoxEnabled = false
  169. local comboFlag = 0
  170. local comboFlag2 = 0
  171. Humanoid.WalkSpeed = 10
  172. Humanoid.Health = 1000
  173. Humanoid.MaxHealth = 1000
  174. Humanoid.JumpPower = 0
  175. Parts.Name = "Hammer"
  176. -- Hammer --
  177. HammerHandle = Instance.new("Part",Parts)
  178. HammerHandle.Size = Vector3.new(7.7,0.25,0.25)
  179. HammerHandle.BrickColor = BrickColor.new("Black")
  180. HammerHandle.Anchored = false
  181. HammerHandle.Locked = true
  182. HammerHandle.Material = "Wood"
  183. HammerHandle.CanCollide = false
  184.  
  185. HammerBlock1 = Instance.new("Part",Parts)
  186. HammerBlock1.Locked = true
  187. HammerBlock1.Size = Vector3.new(1.74,4.20,1.74)
  188. HammerBlock1.BrickColor = BrickColor.new("Black")
  189. HammerBlock1.Anchored = false
  190. HammerBlock1.Material = "Neon"
  191. HammerBlock1.CanCollide = false
  192. HammerBlock1.Locked = true
  193.  
  194. HammerBlock2 = Instance.new("Part",Parts)
  195. HammerBlock2.Size = Vector3.new(1.54,4.45,1.54)
  196. HammerBlock2.BrickColor = BrickColor.new("Dark stone grey")
  197. HammerBlock2.Anchored = false
  198. HammerBlock2.Locked = true
  199. HammerBlock2.Material = "Neon"
  200. HammerBlock2.CanCollide = false
  201.  
  202. HammerBlock3 = Instance.new("Part",Parts)
  203. HammerBlock3.Size = Vector3.new(2,1,2)
  204. HammerBlock3.BrickColor = BrickColor.new("Dark stone grey")
  205. HammerBlock3.Anchored = false
  206. HammerBlock3.Locked = true
  207. HammerBlock3.Material = "Neon"
  208. HammerBlock3.CanCollide = false
  209.  
  210. HammerBlock4 = Instance.new("Part",Parts)
  211. HammerBlock4.Size = Vector3.new(2,1,2)
  212. HammerBlock4.BrickColor = BrickColor.new("Dark stone grey")
  213. HammerBlock4.Anchored = false
  214. HammerBlock4.Locked = true
  215. HammerBlock4.Material = "Neon"
  216. HammerBlock4.CanCollide = false
  217.  
  218. HammerBlock5 = Instance.new("Part",Parts)
  219. HammerBlock5.Size = Vector3.new(1.9,1,1.9)
  220. HammerBlock5.BrickColor = BrickColor.new("Really black")
  221. HammerBlock5.Anchored = false
  222. HammerBlock5.Locked = true
  223. HammerBlock5.Material = "Wood"
  224. HammerBlock5.CanCollide = false
  225.  
  226. HammerBlock6 = Instance.new("Part",Parts)
  227. HammerBlock6.Size = Vector3.new(1.9,1,1.9)
  228. HammerBlock6.BrickColor = BrickColor.new("Really black")
  229. HammerBlock6.Anchored = false
  230. HammerBlock6.Locked = true
  231. HammerBlock6.Material = "Wood"
  232. HammerBlock6.CanCollide = false
  233.  
  234. HammerBlock7 = Instance.new("Part",Parts)
  235. HammerBlock7.Size = Vector3.new(2.15,0.85,2.1)
  236. HammerBlock7.BrickColor = BrickColor.new("Really black")
  237. HammerBlock7.Anchored = false
  238. HammerBlock7.Locked = true
  239. HammerBlock7.Material = "Wood"
  240. HammerBlock7.CanCollide = false
  241.  
  242. HammerBlock8 = Instance.new("Part",Parts)
  243. HammerBlock8.Size = Vector3.new(2.15,0.85,2.1)
  244. HammerBlock8.BrickColor = BrickColor.new("Really black")
  245. HammerBlock8.Anchored = false
  246. HammerBlock8.Locked = true
  247. HammerBlock8.Material = "Wood"
  248. HammerBlock8.CanCollide = false
  249. HammerHitBox = Instance.new("Part",Parts)
  250. HammerHitBox.Size = Vector3.new(8.2,4.8,2.25)
  251. HammerHitBox.BrickColor = BrickColor.new("Really red")
  252. HammerHitBox.Transparency = 1
  253. HammerHitBox.Anchored = false
  254. HammerHitBox.Locked = true
  255. HammerHitBox.Material = "Neon"
  256. HammerHitBox.CanCollide = false
  257. HammerHitBoxHandle = Instance.new("Part",Parts)
  258. HammerHitBoxHandle.Size = Vector3.new(7.92,0.55,0.55)
  259. HammerHitBoxHandle.BrickColor = BrickColor.new("Really red")
  260. HammerHitBoxHandle.Transparency = 1
  261. HammerHitBoxHandle.Anchored = false
  262. HammerHitBoxHandle.Locked = true
  263. HammerHitBoxHandle.Material = "Neon"
  264. HammerHitBoxHandle.CanCollide = false
  265. HammerSquare1 = Instance.new("Part",Parts)
  266. HammerSquare1.Size = Vector3.new(0.25,0.45,0.45)
  267. HammerSquare1.BrickColor = BrickColor.new("Dark stone grey")
  268. HammerSquare1.Anchored = false
  269. HammerSquare1.Locked = true
  270. HammerSquare1.Material = "Concrete"
  271. HammerSquare1.CanCollide = false
  272. HammerSquare2 = Instance.new("Part",Parts)
  273. HammerSquare2.Size = Vector3.new(0.25,0.45,0.45)
  274. HammerSquare2.BrickColor = BrickColor.new("Dark stone grey")
  275. HammerSquare2.Anchored = false
  276. HammerSquare2.Locked = true
  277. HammerSquare2.Material = "Concrete"
  278. HammerSquare2.CanCollide = false
  279. HammerSwing1 = Instance.new("Sound",HammerHitBox)
  280. HammerSwing1.SoundId = "rbxassetid://145486992"
  281. HammerSwing1.Volume = 1
  282. HammerSwing2 = Instance.new("Sound",HammerHitBox)
  283. HammerSwing2.SoundId = "rbxassetid://246930031"
  284. HammerSwing2.Volume = 2
  285. HammerContact = Instance.new("Sound",HammerHitBox)
  286. HammerContact.SoundId = "rbxassetid://130791043"
  287. HammerContact.Volume = 1
  288. HammerContact2 = Instance.new("Sound",HammerHitBox)
  289. HammerContact2.SoundId = "rbxassetid://146163534"
  290. HammerContact2.Volume = 1
  291.  
  292. -- Welds --
  293. local leftArmWeld = Instance.new("Weld",Character["Left Arm"])
  294. local leftLegWeld = Instance.new("Weld",Character["Left Leg"])
  295. local rightArmWeld = Instance.new("Weld",Character["Right Arm"])
  296. local rightLegWeld = Instance.new("Weld",Character["Right Leg"])
  297. local hammerHandleWeld = Instance.new("Weld",Character["Right Arm"])
  298. local hammerBlock1Weld = Instance.new("Weld",hammerHandleWeld)
  299. local hammerBlock2Weld = Instance.new("Weld",hammerHandleWeld)
  300. local hammerBlock3Weld = Instance.new("Weld",hammerHandleWeld)
  301. local hammerBlock4Weld = Instance.new("Weld",hammerHandleWeld)
  302. local hammerBlock5Weld = Instance.new("Weld",hammerHandleWeld)
  303. local hammerBlock6Weld = Instance.new("Weld",hammerHandleWeld)
  304. local hammerBlock7Weld = Instance.new("Weld",hammerHandleWeld)
  305. local hammerBlock8Weld = Instance.new("Weld",hammerHandleWeld)
  306. local hammerHitBoxWeld = Instance.new("Weld",hammerHandleWeld)
  307. local hammerHitBoxHandleWeld = Instance.new("Weld",hammerHandleWeld)
  308. local HammerSquare1Weld = Instance.new("Weld",hammerHandleWeld)
  309. local HammerSquare2Weld = Instance.new("Weld",hammerHandleWeld)
  310. local headWeld = Instance.new("Weld",Head)
  311. local torsoWeld = Instance.new("Weld",Torso)
  312. -- WeldsPartC0 --
  313. leftArmWeld.Part0 = Torso
  314. leftArmWeld.Part1 = Character["Left Arm"]
  315. leftArmWeld.C0 = CFrame.new(-1,0.5,0)
  316. rightArmWeld.Part0 = Torso
  317. rightArmWeld.Part1 = Character["Right Arm"]
  318. rightArmWeld.C0 = CFrame.new(1,0.5,0)
  319. leftLegWeld.Part0 = Torso
  320. leftLegWeld.Part1 = Character["Left Leg"]
  321. leftLegWeld.C0 = CFrame.new(-0.5,-1.0,0)
  322. rightLegWeld.Part0 = Torso
  323. rightLegWeld.Part1 = Character["Right Leg"]
  324. rightLegWeld.C0 = CFrame.new(0.5,-1.0,0)
  325. hammerHandleWeld.Part0 = Character["Right Arm"]
  326. hammerHandleWeld.Part1 = HammerHandle
  327. hammerHandleWeld.C0 = CFrame.new(0,-.90,0)
  328. hammerBlock1Weld.Part0 = HammerHandle
  329. hammerBlock1Weld.Part1 = HammerBlock1
  330. hammerBlock1Weld.C0 = CFrame.new(-2.5,0,0)
  331. hammerBlock2Weld.Part0 = HammerBlock1
  332. hammerBlock2Weld.Part1 = HammerBlock2
  333. hammerBlock2Weld.C0 = CFrame.new(0,0,0)
  334. hammerBlock3Weld.Part0 = HammerBlock1
  335. hammerBlock3Weld.Part1 = HammerBlock3
  336. hammerBlock3Weld.C0 = CFrame.new(0,1.55,0)
  337. hammerBlock4Weld.Part0 = HammerBlock1
  338. hammerBlock4Weld.Part1 = HammerBlock4
  339. hammerBlock4Weld.C0 = CFrame.new(0,-1.55,0)
  340. hammerBlock5Weld.Part0 = HammerBlock1
  341. hammerBlock5Weld.Part1 = HammerBlock5
  342. hammerBlock5Weld.C0 = CFrame.new(0,1,0)
  343. hammerBlock6Weld.Part0 = HammerBlock1
  344. hammerBlock6Weld.Part1 = HammerBlock6
  345. hammerBlock6Weld.C0 = CFrame.new(0,-1,0)
  346. hammerBlock7Weld.Part0 = HammerBlock1
  347. hammerBlock7Weld.Part1 = HammerBlock7
  348. hammerBlock7Weld.C0 = CFrame.new(0,1.7,0)
  349. hammerBlock8Weld.Part0 = HammerBlock1
  350. hammerBlock8Weld.Part1 = HammerBlock8
  351. hammerBlock8Weld.C0 = CFrame.new(0,-1.7,0)
  352. hammerHitBoxWeld.Part0 = HammerBlock1
  353. hammerHitBoxWeld.Part1 = HammerHitBox
  354. hammerHitBoxWeld.C0 = CFrame.new(2.4,0,0)
  355. hammerHitBoxHandleWeld.Part0 = HammerHandle
  356. hammerHitBoxHandleWeld.Part1 = HammerHitBoxHandle
  357. hammerHitBoxHandleWeld.C0 = CFrame.new(0,0,0)
  358. HammerSquare1Weld.Part0 = HammerBlock1
  359. HammerSquare1Weld.Part1 = HammerSquare1
  360. HammerSquare1Weld.C0 = CFrame.new(-.9,0,0)
  361. HammerSquare2Weld.Part0 = HammerBlock1
  362. HammerSquare2Weld.Part1 = HammerSquare2
  363. HammerSquare2Weld.C0 = CFrame.new(.9,0,0)
  364. torsoWeld.Part0 = HammerHandleWeld
  365. torsoWeld.Part1 = Torso
  366. headWeld.Part0 = Torso
  367. headWeld.Part1 = Head
  368. headWeld.C0 = CFrame.new(0,1,0)
  369. --[[
  370. local billboard = Instance.new("BillboardGui")
  371. billboard.Size = UDim2.new(1,0,1,0)
  372. billboard.Parent = HammerSquare1
  373. billboard.AlwaysOnTop = true
  374.  
  375. local frame = Instance.new("Frame",billboard)
  376. frame.BorderSizePixel = 0
  377. frame.Transparency = 1
  378. frame.Size = UDim2.new(1,0,1,0)
  379.  
  380. local image = Instance.new("TextLabel",frame)
  381. image.Size = UDim2.new(1.5,0,1,0)
  382. image.BorderSizePixel = 2
  383. image.TextTransparency = 0
  384. image.TextSize = 35
  385. image.BackgroundTransparency = 1
  386. image.Font = Enum.Font.SourceSansBold
  387. image.TextColor3 = Color3.new(0,0,0)
  388. image.TextStrokeTransparency = 0
  389. image.TextStrokeColor3 = Color3.new(255,255,255)
  390. ]]
  391.  
  392. -- Functions --
  393. local function Debris(x,y,z)
  394. wait(1)
  395. for i = 1,14 do
  396. z.TextTransparency = z.TextTransparency + 0.1
  397. z.TextStrokeTransparency = z.TextStrokeTransparency + 0.1
  398. wait()
  399. end
  400. game:GetService("Debris"):AddItem(x,y)
  401. end
  402. function Chat(playername,pos)
  403. local billboard = Instance.new("BillboardGui")
  404. billboard.Size = UDim2.new(1,0,1,0)
  405. billboard.Parent = HammerSquare1
  406. billboard.AlwaysOnTop = true
  407.  
  408. local frame = Instance.new("Frame",billboard)
  409. frame.BorderSizePixel = 0
  410. frame.Transparency = 1
  411. frame.Size = UDim2.new(1,0,1,0)
  412.  
  413. local image = Instance.new("TextLabel",frame)
  414. image.Size = UDim2.new(1.5,0,1,0)
  415. image.BorderSizePixel = 2
  416. image.TextTransparency = 0
  417. image.TextSize = 35
  418. image.BackgroundTransparency = 1
  419. image.Font = Enum.Font.SourceSansBold
  420. image.TextColor3 = Color3.new(0,0,0)
  421. image.TextStrokeTransparency = 0
  422. image.TextStrokeColor3 = Color3.new(255,255,255)
  423. image.Text = "[ "..playername.." ] has been nil'd."
  424. Spawn(function()
  425. Debris(billboard,1,image)
  426.  
  427. end)
  428. end
  429.  
  430.  
  431. -- Walking Idle --
  432. Spawn(function()
  433. while RunService.Stepped:Wait() do
  434. if hitBoxEnabled == true then
  435. HammerHitBox.Transparency = 0.85
  436. HammerHitBoxHandle.Transparency = 0.85
  437. else
  438. HammerHitBox.Transparency = 01
  439. HammerHitBoxHandle.Transparency = 1
  440. end
  441. local positionSpeed = (HammerHandleWeld.Velocity * Vector3.new(1,0,1)).magnitude
  442. if positionSpeed < 1 then
  443. if clickDebounce == true then repeat wait() until clickDebounce == false end
  444. leftArmWeld.C1 = leftArmWeld.C1:Lerp(CFrame.new(0.5,0.5,0) * CFrame.Angles(-math.rad(70),math.rad(15),-math.rad(45)),0.2)
  445. rightArmWeld.C1 = rightArmWeld.C1:Lerp(CFrame.new(-0.5,0.5,0) * CFrame.Angles(-math.rad(45),0,math.rad(45) + -math.cos(tick()*4)/17),0.2)
  446. leftLegWeld.C1 = leftLegWeld.C1:Lerp(CFrame.new(0,1 + -math.cos(tick()*4)/17,0) * CFrame.Angles(-math.rad(15),-math.rad(50) + math.cos(tick()*4)/17,0),0.2)
  447. rightLegWeld.C1 = rightLegWeld.C1:Lerp(CFrame.new(0,1 + -math.cos(tick()*4)/17,0) * CFrame.Angles(math.rad(15),-math.rad(50) + math.cos(tick()*4)/17,0),0.2)
  448. torsoWeld.C1 = torsoWeld.C1:Lerp(CFrame.new(0,math.cos(tick()*4)/17,0) * CFrame.Angles(0,math.rad(55),0),0.2)
  449. headWeld.C1 = headWeld.C1:Lerp(CFrame.new(0,-0.5,0) * CFrame.Angles(math.rad(5),-math.rad(45),0),0.2)
  450. hammerBlock1Weld.C1 = hammerBlock1Weld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),0,0),0.2)
  451. hammerHandleWeld.C1 = hammerHandleWeld.C1:Lerp(CFrame.new(2.5,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),0.2)
  452. elseif positionSpeed > 1 then
  453. if clickDebounce == true then repeat wait() until clickDebounce == false end
  454. leftArmWeld.C1 = leftArmWeld.C1:Lerp(CFrame.new(0.5,0.5,0) * CFrame.Angles(-math.rad(120),math.rad(45),math.rad(45)),0.2)
  455. rightArmWeld.C1 = rightArmWeld.C1:Lerp(CFrame.new(-0.5,0.5,0) * CFrame.Angles(-math.rad(45),-math.rad(170),math.rad(160) ),0.2)
  456. leftLegWeld.C1 = leftLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.cos(tick()*6)/2,-math.rad(50),0),0.2)
  457. rightLegWeld.C1 = rightLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(-math.cos(tick()*6)/2,-math.rad(50),0),0.2)
  458. torsoWeld.C1 = torsoWeld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(55),0),0.2)
  459. headWeld.C1 = headWeld.C1:Lerp(CFrame.new(0,-0.5,0) * CFrame.Angles(math.rad(5),-math.rad(45),0),0.2)
  460. hammerBlock1Weld.C1 = hammerBlock1Weld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(math.rad(45),0,0),0.2)
  461. hammerHandleWeld.C1 = hammerHandleWeld.C1:Lerp(CFrame.new(2.5,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)),0.2)
  462. end
  463.  
  464. end
  465. end)
  466. --
  467. local lastAttack = 0
  468. local lastHit = ""
  469. function KeyPress(Key)
  470. if Key == Enum.KeyCode.E then
  471. wait()
  472. local t = game:GetService("RunService").Stepped:wait()
  473. if (t - lastAttack) > 0.7 or comboFlag2 == 2 then
  474. comboFlag2 = 0
  475. end
  476. if clickDebounce then return end
  477. clickDebounce = true
  478. if comboFlag2 == 0 then
  479. HammerSwing1:Play()
  480. for i = 1,15 do
  481. leftArmWeld.C1 = leftArmWeld.C1:Lerp(CFrame.new(0.5,0.5,0) * CFrame.Angles(math.rad(55),-math.rad(35),math.rad(45)),0.3)
  482. rightArmWeld.C1 = rightArmWeld.C1:Lerp(CFrame.new(-0.5,0.5,0) * CFrame.Angles(-math.rad(120),-math.rad(45),-math.rad(55)),0.3)
  483. leftLegWeld.C1 = leftLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(0),-math.rad(0),0),0.3)
  484. rightLegWeld.C1 = rightLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(0),-math.rad(0),0),0.3)
  485. torsoWeld.C1 = torsoWeld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(-math.rad(0),-math.rad(35),0),0.3)
  486. headWeld.C1 = headWeld.C1:Lerp(CFrame.new(0,-0.5,0) * CFrame.Angles(0,-math.rad(75),0),0.3)
  487. hammerBlock1Weld.C1 = hammerBlock1Weld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),0,0),0.3)
  488. hammerHandleWeld.C1 = hammerHandleWeld.C1:Lerp(CFrame.new(2.5,0,0) * CFrame.Angles(math.rad(0),math.rad(0),-math.rad(30)),0.3)
  489. game:GetService("RunService").Stepped:wait()
  490. end
  491. local connection1 = HammerHitBox.Touched:connect(function(hit)
  492. pcall(function()
  493. if hit.Parent == Character then return end
  494. if hit.Parent.Name == lastHit then return end
  495. debounce = true
  496. local human = hit.Parent:FindFirstChildOfClass("Humanoid")
  497. if human and debounce then
  498. asd = hit.Parent
  499. lastHit = asd.Name
  500. human:TakeDamage(15)
  501. HammerContact2:Play()
  502. asd:FindFirstChild("Torso").Velocity = Torso.CFrame.lookVector * 200
  503. end
  504. end)
  505. end)
  506. lastHit = ""
  507. wait()
  508. for i = 1,9 do -- move 1
  509. leftArmWeld.C1 = leftArmWeld.C1:Lerp(CFrame.new(0.5,0.5,0) * CFrame.Angles(math.rad(10),-math.rad(35),math.rad(45)),0.3)
  510. rightArmWeld.C1 = rightArmWeld.C1:Lerp(CFrame.new(-0.5,0.5,0) * CFrame.Angles(-math.rad(100),math.rad(75),-math.rad(0)),0.3)
  511. leftLegWeld.C1 = leftLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(0),-math.rad(0),0),0.3)
  512. rightLegWeld.C1 = rightLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(0),-math.rad(0),0),0.3)
  513. torsoWeld.C1 = torsoWeld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(-math.rad(0),-math.rad(0),0),0.3)
  514. headWeld.C1 = headWeld.C1:Lerp(CFrame.new(0,-0.5,0) * CFrame.Angles(0,math.rad(50),0),0.3)
  515. hammerBlock1Weld.C1 = hammerBlock1Weld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),0,0),0.3)
  516. hammerHandleWeld.C1 = hammerHandleWeld.C1:Lerp(CFrame.new(2.5,0,0) * CFrame.Angles(math.rad(0),math.rad(0),-math.rad(30)),0.3)
  517. game:GetService("RunService").Stepped:wait()
  518. end
  519. connection1:disconnect()
  520. wait(0.35)
  521. clickDebounce = false
  522. debounce = false
  523. comboFlag2 = comboFlag2 + 1
  524. lastAttack = t
  525. elseif comboFlag2 == 1 then
  526. local connection2 = HammerHitBox.Touched:connect(function(hit)
  527. pcall(function()
  528. if hit.Parent == Character then return end
  529. if hit.Parent.Name == lastHit then return end
  530. debounce = true
  531. local human = hit.Parent:FindFirstChildOfClass("Humanoid")
  532. if human and debounce then
  533. asd = hit.Parent
  534. lastHit = asd.Name
  535. human:TakeDamage(15)
  536. HammerContact2:Play()
  537. asd:FindFirstChild("Torso").Velocity = Torso.CFrame.lookVector * 200
  538. end
  539. end)
  540. end)
  541. for i = 1,15 do -- move 1
  542. leftArmWeld.C1 = leftArmWeld.C1:Lerp(CFrame.new(0.5,0.5,0) * CFrame.Angles(math.rad(10),-math.rad(35),math.rad(45)),0.3)
  543. rightArmWeld.C1 = rightArmWeld.C1:Lerp(CFrame.new(-0.5,0.5,0) * CFrame.Angles(-math.rad(100),math.rad(75),-math.rad(0)),0.3)
  544. leftLegWeld.C1 = leftLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(0),-math.rad(0),0),0.3)
  545. rightLegWeld.C1 = rightLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(0),-math.rad(0),0),0.3)
  546. torsoWeld.C1 = torsoWeld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(-math.rad(0),-math.rad(0),0),0.3)
  547. headWeld.C1 = headWeld.C1:Lerp(CFrame.new(0,-0.5,0) * CFrame.Angles(0,math.rad(50),0),0.3)
  548. hammerBlock1Weld.C1 = hammerBlock1Weld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),0,0),0.3)
  549. hammerHandleWeld.C1 = hammerHandleWeld.C1:Lerp(CFrame.new(2.5,0,0) * CFrame.Angles(math.rad(0),math.rad(0),-math.rad(30)),0.3)
  550. game:GetService("RunService").Stepped:wait()
  551. end
  552. wait()
  553. for i = 1,9 do
  554. leftArmWeld.C1 = leftArmWeld.C1:Lerp(CFrame.new(0.5,0.5,0) * CFrame.Angles(math.rad(55),-math.rad(35),math.rad(45)),0.3)
  555. rightArmWeld.C1 = rightArmWeld.C1:Lerp(CFrame.new(-0.5,0.5,0) * CFrame.Angles(-math.rad(120),-math.rad(45),-math.rad(55)),0.3)
  556. leftLegWeld.C1 = leftLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(0),-math.rad(0),0),0.3)
  557. rightLegWeld.C1 = rightLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(0),-math.rad(0),0),0.3)
  558. torsoWeld.C1 = torsoWeld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(-math.rad(0),-math.rad(35),0),0.3)
  559. headWeld.C1 = headWeld.C1:Lerp(CFrame.new(0,-0.5,0) * CFrame.Angles(0,-math.rad(75),0),0.3)
  560. hammerBlock1Weld.C1 = hammerBlock1Weld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),0,0),0.3)
  561. hammerHandleWeld.C1 = hammerHandleWeld.C1:Lerp(CFrame.new(2.5,0,0) * CFrame.Angles(math.rad(0),math.rad(0),-math.rad(30)),0.3)
  562. game:GetService("RunService").Stepped:wait()
  563. end
  564. connection2:disconnect()
  565. clickDebounce = false
  566. debounce = false
  567. lastAttack = t
  568. comboFlag2 = comboFlag2 + 1
  569. end
  570.  
  571. elseif Key == Enum.KeyCode.Z then
  572. if hitBoxEnabled == false then
  573. wait(1)
  574. hitBoxEnabled = true
  575. else
  576. hitBoxEnabled = false
  577. end
  578.  
  579. elseif Key == Enum.KeyCode.Q then
  580. wait()
  581. if clickDebounce then return end
  582. clickDebounce = true
  583. local connection1 = HammerHitBox.Touched:connect(function(hit)
  584. pcall(function()
  585. if hit.Parent == Character then return end
  586. if hit.Parent.Name == lastHit then return end
  587. debounce = true
  588. local human = hit.Parent:FindFirstChildOfClass("Humanoid")
  589. if human and debounce then
  590. asd = hit.Parent
  591. lastHit = asd.Name
  592. HammerContact:Play()
  593. asd.Parent = nil
  594. if asd.Parent == nil then
  595. Chat(asd.Name)
  596. end
  597. end
  598. end)
  599. end)
  600. lastHit = ""
  601. HammerSwing1:Play()
  602. for i = 1,15 do
  603. leftArmWeld.C1 = leftArmWeld.C1:Lerp(CFrame.new(0.5,1,0) * CFrame.Angles(-math.rad(190),-math.rad(0),math.rad(35)),0.3)
  604. rightArmWeld.C1 = rightArmWeld.C1:Lerp(CFrame.new(-0.5,1,0) * CFrame.Angles(-math.rad(190),math.rad(0),-math.rad(35)),0.3)
  605. leftLegWeld.C1 = leftLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(25),-math.rad(0),0),0.3)
  606. rightLegWeld.C1 = rightLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(25),-math.rad(0),0),0.3)
  607. torsoWeld.C1 = torsoWeld.C1:Lerp(CFrame.new(0,-3,0) * CFrame.Angles(-math.rad(35),-math.rad(0),0),0.3)
  608. headWeld.C1 = headWeld.C1:Lerp(CFrame.new(0,-0.5,0) * CFrame.Angles(math.rad(0),-math.rad(0),0),0.3)
  609. hammerBlock1Weld.C1 = hammerBlock1Weld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),0,0),0.3)
  610. hammerHandleWeld.C1 = hammerHandleWeld.C1:Lerp(CFrame.new(2.5,0.5,0) * CFrame.Angles(math.rad(5),math.rad(90),math.rad(0)),0.3)
  611. game:GetService("RunService").Stepped:wait()
  612. end
  613. wait(0.25)
  614. HammerSwing2:Play()
  615. for i = 1,9 do -- move 1
  616. leftArmWeld.C1 = leftArmWeld.C1:Lerp(CFrame.new(0.5,1,0) * CFrame.Angles(-math.rad(112),math.rad(25),math.rad(35)),0.2)
  617. rightArmWeld.C1 = rightArmWeld.C1:Lerp(CFrame.new(-0.5,1,0) * CFrame.Angles(-math.rad(112),-math.rad(25),-math.rad(35)),0.2)
  618. leftLegWeld.C1 = leftLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(25),-math.rad(0),0),0.2)
  619. rightLegWeld.C1 = rightLegWeld.C1:Lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(25),-math.rad(0),0),0.2)
  620. torsoWeld.C1 = torsoWeld.C1:Lerp(CFrame.new(0,3,0) * CFrame.Angles(math.rad(145),-math.rad(0),0),0.2)
  621. headWeld.C1 = headWeld.C1:Lerp(CFrame.new(0,-0.5,0) * CFrame.Angles(math.rad(0),-math.rad(0),0),0.2)
  622. hammerBlock1Weld.C1 = hammerBlock1Weld.C1:Lerp(CFrame.new(0,0,0) * CFrame.Angles(math.rad(104),0,0),0.2)
  623. hammerHandleWeld.C1 = hammerHandleWeld.C1:Lerp(CFrame.new(2.5,0,0) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(60)),0.2)
  624. game:GetService("RunService").Stepped:wait()
  625. end
  626. connection1:disconnect()
  627. wait(0.35)
  628. clickDebounce = false
  629. debounce = false
  630. end
  631. end
  632.  
  633. if InputService.KeyboardEnabled then
  634. function onInput(input,processed)
  635. if input.UserInputType == Enum.UserInputType.Keyboard then
  636. KeyPress(input.KeyCode)
  637.  
  638. end
  639. end
  640. end
  641. InputService.InputBegan:connect(onInput)
  642. InputService.InputChanged:connect(onInput)
Advertisement
Add Comment
Please, Sign In to add comment