My game currently has a script that a friend of mine made for a “Running/Dash” ability.
The script works like this:
-When the player presses the keybind (in this case, R), their walkspeed increases.
-After 5 seconds, the player’s walkspeed goes back to normal
-After 10 seconds, the player can use the ability again
https://gyazo.com/cb3da24ecdca7864405bf88d17b6e44e
(NOTE: the script for this ability is located in the “StarterGui”, as it also uses the player’s GUI to showcase stuff like how much time is left for the ability to come back, etc.)
https://gyazo.com/22a471c69f1298dffb2a75cbe51d3923
I wanted to make some changes to the script so that the animation changes whenever the player is using this ability.
My game uses custom animations and I currently input custom animations by using an “Animate” LocalScript inside of the StarterPlayerScripts.
https://gyazo.com/00a064fbdf4b452bef1db905541a1f21
I added a variable to the script that focused on the AnimationID of the player’s walking animation. I called it “currentWalkAnim”
https://gyazo.com/40b887c5ce850cf17d117701ce284079
The script was supposed to change to the new custom running animation for 5 seconds, then it would change back to the original. The issue is, the animation doesn’t change at all, it just keeps the same one as before without any changes whatsoever.
https://gyazo.com/11acbf17be82578dd5f9a41f5ad764de
https://gyazo.com/22b73ef14e586a444a1ec2cb688d7a29
All I really need is to make it so I can change the animation whenever the player presses the keybind. I’ve tried changing the script’s location to StarterCharacterScripts but it just breaks the GUI mechanic. Any ideas on how to fix this?