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

Speed potion: Animation won't activate when clicking? How do I fix this?

Asked by 6 years ago

I wanted to make this speed potion tool, I made an animation for it using animation editor. I'm new to scripting so I may have made a stupid mistake. Animations name is ZTZ, that's what that's about down there.

local CanActivate = true
local player = game.Players,LocalPlayer
local character = player.Character

script.Parent.Activated:connect(function()
    if CanActivate = true then
        local animation = character.Humanoid:LoadAnimation(script.Parent.ZTZ)
        animation:Play()
    end
end)

Any idea what I did wrong? Any help on this and how to avoid making the same mistake would be very helpful! Thank you! :D

0
local player = game.Players.LocalPlayer* You added "," instead of "." after "Players" xdeno 187 — 6y
0
Well, as I said a stupid mistake may have been made... Thank you very much for pointing that out Xdeno. So after changing "," to "." it should begin to work? mullenman 4 — 6y
0
Tested it, guess no... But that was still a problem, I am now one step closer to fixing this thanks to you! mullenman 4 — 6y

Answer this question