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

How do I put an animation in a tool and when i click it plays?

Asked by 4 years ago

I've been trying to make a lifting game but I don't know how to make it when I click the grip of the players hand while holding the tool and when the player equips the tool it automatically goes to that position and when they click with the tool equipped the animation plays. Here is the script I have at the moment.

local player = game:GetService("Players").LocalPlayer
local  AnimObj = Instance.new("Animation",(script.Parent))
AnimObj.AnimationId = "rbxassetid://3521863428"
local debounce = true
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
script.Parent.Activated:Connect(function()
    if debounce == true then
    debounce = false
    local AnimTrack = humanoid:LoadAnimation(AnimObj)
    AnimTrack:Play()
    debounce = true
    end
end)

please help me I don't know whats wrong I also want a custom equipped animation so when they equip the tool the players hand and the tool moves.

0
That looks pretty good...anything in the output? ChasingNachos 133 — 4y

Answer this question