Advertisement
ScriptMaket

punch script for roblox studio

Apr 25th, 2024
814
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | Source Code | 0 0
  1.  
  2.  
  3. ```lua
  4. -- Get the player's character
  5. local player = game.Players.LocalPlayer
  6. local character = player.Character or player.CharacterAdded:Wait()
  7.  
  8. -- Get the player's Humanoid
  9. local humanoid = character:WaitForChild("Humanoid")
  10.  
  11. -- Create a punch function
  12. local function punch()
  13.     -- Play a punch animation
  14.     local animation = Instance.new("Animation")
  15.     animation.AnimationId = "rbxassetid://3587619640"
  16.     local animationTrack = humanoid:LoadAnimation(animation)
  17.     animationTrack:Play()
  18.  
  19.     -- Apply damage to the target
  20.     local target = humanoid.Parent:FindFirstChild("Humanoid")
  21.     if target then
  22.         target:TakeDamage(10000) -- Deal 10000 damage to the target
  23.     end
  24. end
  25.  
  26. -- Bind the punch function to a key press
  27. local userInputService = game:GetService("UserInputService")
  28. userInputService.InputBegan:Connect(function(input, gameProcessed)
  29.     if input.KeyCode == Enum.KeyCode.F and not gameProcessed then
Tags: #roblox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement