Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```lua
- -- Get the player's character
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- -- Get the player's Humanoid
- local humanoid = character:WaitForChild("Humanoid")
- -- Create a punch function
- local function punch()
- -- Play a punch animation
- local animation = Instance.new("Animation")
- animation.AnimationId = "rbxassetid://3587619640"
- local animationTrack = humanoid:LoadAnimation(animation)
- animationTrack:Play()
- -- Apply damage to the target
- local target = humanoid.Parent:FindFirstChild("Humanoid")
- if target then
- target:TakeDamage(10000) -- Deal 10000 damage to the target
- end
- end
- -- Bind the punch function to a key press
- local userInputService = game:GetService("UserInputService")
- userInputService.InputBegan:Connect(function(input, gameProcessed)
- if input.KeyCode == Enum.KeyCode.F and not gameProcessed then
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement