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

How do i make it so when you click an animation plays?

Asked by
notfenv 171
5 years ago
Edited 5 years ago

So basically a starting player has this tool called pushup, They equip it and Anim0 plays. (which is like in push up pose but not doing it and this is r15)

Whenever they click, Anim1 Plays, Anim 1 is the pushup, then they gain +1 Strength (Leaderstats int. value)

local tool = script.Parent
local event = game.ReplicatedStorage.StrengthEvent
local debounce = false

tool.Activated:Connect(function()
if not debounce then
debounce = true
event:FireServer()
wait(1)
debounce = false
end    
end)

tool = script.Parent
local sword = true
tool.Activated:Connect(function()
    if sword == false then return end
    sword = false
    local char = tool.Parent
    local hum = char.Humanoid

    local anim = hum:LoadAnimation(script.Parent.Anim0)
    anim:Play()
    wait(1)
    sword = true
        local anim = hum:LoadAnimation(script.Parent.Anim1)
    anim:Play()
    wait(1)
    sword = true
end)

Please note that the animations are in the tool, not the handle, and please put your examples in answers, i cannot understand through comments.

0
You are loading then playing an animation? pls explain in more detail about what the problem is. User#5423 17 — 5y
0
Basically someone equips the tool and the first animation plays, When you unequip you stand up, When you click with the tool Anim1 plays which is a pushup, and the leaderstat intvalue increases for the player, also im wondering how to make it so when u stand in an object the leaderstat int value rises every 1.25 seconds, if ur out of it then you dont gain, (INT VALUE FROM QUESTION IS "Strength") notfenv 171 — 5y

Answer this question