Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Would I Go About Making A Boxing Punch Script?

Asked by 4 years ago

I already have the animation and it's bound to a key and it works, how could I make it so when the fighter connects it does damage to the person that got hit?

local Player = game.Players.LocalPlayer local Character = Player.Character or script.Parent local Humanoid = Character.Humanoid local UserInputService = game:GetService("UserInputService") local Debounce = true

local AnimationId = 'rbxassetid://4931196953'

local Key = "E"

UserInputService.InputBegan:Connect(function(Input, IsTyping) if IsTyping then return end if Input.KeyCode == Enum.KeyCode[Key] and Debounce == true then local Animation = Instance.new("Animation") Animation.AnimationId = AnimationId local LoadAnimation = Humanoid:LoadAnimation(Animation) LoadAnimation:Play() wait(1) Animation:Destroy() Debounce = true

end

end)

local Player = game.Players.LocalPlayer local Character = Player.Character or script.Parent local Humanoid = Character.Humanoid local UserInputService = game:GetService("UserInputService") local Debounce = true

local AnimationId = 'rbxassetid://4931196953'

local Key = "E"

UserInputService.InputBegan:Connect(function(Input, IsTyping) if IsTyping then return end if Input.KeyCode == Enum.KeyCode[Key] and Debounce == true then local Animation = Instance.new("Animation") Animation.AnimationId = AnimationId local LoadAnimation = Humanoid:LoadAnimation(Animation) LoadAnimation:Play() wait(1) Animation:Destroy() Debounce = true

end

end)

Those are the 2 punch animation scripts

Please Thanks.

Answer this question