#Code Refuses To Stop Animation
35 messages · Page 1 of 1 (latest)
If you want to update the global variable, remove the "local" for isplaying inside your function
ooooh okay, I'll try that then, thanks.
like this, right? because now it won't play the animation in the first place
Oh that's because you have two separate if statements. Try doing If, else instead
alright, I'll do that then.
like this, right?
oh wait woops
forgot to remove part from before XD
there
Yeah should be good
well, it still won't play the animation now.
** You are now Level 3! **
actually, restarting the game, now it DOES play the animation but still just won't stop the animation.
I've done that previously as well and any time I have it's just refused to play the animation at all, but I'll try it again.
yeah no it won't play the animation now.
this script here, it doesn't play the animation.
Do you have any errors in output?
I've never even gotten any output from anything
not even print beforehand has given me any outputs
Go to View tab and hover over an icon button called "Output". Should be around the top left of View tab then click on that
ooooh okay, I actually thought output was on by default XD
bruh one of my scripts randomly disappeared that controls the GUI I need to test my code.
alright, so, here's the output.
Figured the issue might be related to this
Ok replace line 3 with this:
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local humanoid = Character:WaitForChild("Humanoid")
okay, well, I actually just replaced the FindFirstChild with WaitForChild, and that works perfectly
it both plays, and stops, the animation now. thanks for your help!
Yeah I just want to point out one more thing
The reason why you're receiving that error is because sometimes the script will run before the humanoid even gets the chance to completely load
yeah I assumed so after noticing you changed it from FindFirstChild to WaitForChild
I just kinda assumed the player model was loaded before the script in the UI XD
Yeah just be careful with Player Character models too, sometimes they don't load in as expected