|
| 30 Apr 2017 08:11 AM |
This keydown script for animation doesn't work for R15 animations.Any way to make it compatible? local player = game.Players.LocalPlayer local mouse = player:GetMouse() local punchSound = script:WaitForChild("PunchS") local punchS = punchSound:Clone() local punch = script:WaitForChild("Punch") local kick = script:WaitForChild("Kick") local trips = script:WaitForChild("TripS") repeat wait() until player.Character local char = player.Character local humanoid = char:WaitForChild("Humanoid") punchS.Parent = char:WaitForChild("Torso") local enabled = true
--Changeable-- local kickdamage = 30 local punchdamage = 15 local kickcooldown = 0.3 local punchcooldown = 0.1 --------------
mouse.KeyDown:connect(function(key) if key:lower() == "q" and humanoid and enabled then enabled = false humanoid:LoadAnimation(kick):Play() punchS:Play() local ra### #a############################har.Head.CFrame.lookVector * 4) local hit = game.Workspace:FindPartOnRayWithIgnoreList(ray, {char.Torso, char["Left Arm"], char["Right Arm"]}) if hit then if hit.Name == "Torso" or hit.Name == "Left Arm" or hit.Name == "Right Arm" then local targethumanoid = hit.Parent:FindFirstChild("Humanoid") if targethumanoid then targethumanoid:TakeDamage(kickdamage) trips:Clone() trips.Parent = targethumanoid trips.Disabled = false end end end wait(kickcooldown) enabled = true elseif key:lower() == "e" and humanoid and enabled then enabled = false humanoid:LoadAnimation(punch):Play() punchS:Play() local ra### #a############################har.Head.CFrame.lookVector * 4) local hit = game.Workspace:FindPartOnRayWithIgnoreList(ray, {char.Torso, char["Left Arm"], char["Right Arm"]}) if hit then if hit.Name == "Torso" or hit.Name == "Left Arm" or hit.Name == "Right Arm" then local targethumanoid = hit.Parent:FindFirstChild("Humanoid") if targethumanoid then targethumanoid:TakeDamage(punchdamage) end end end wait(punchcooldown) enabled = true end |
|
|
| Report Abuse |
|