#Animation keeps playing when i let go of prompt

1 messages · Page 1 of 1 (latest)

full breach
#

I want an animation to play when I hold a prompt and that part works, but when I let go of it before i finish holding the prompt, the animation keeps playing, I tried adding a debounce but it doesn't seem to have done anything. I feel like the solution to this is creating an if statement but how would I go about doing that (really new to scripting)

cold hare
#

may i ask why did you put it inside the PlayerAdded function?

#

that makes no sense

#

the debounce makes no sense as well

#

and there's something like PromptButtonHoldEnded too

#

just use it

#

and to make your code better do plr.Thirst.Value += 10

orchid torrent
#

yeah do what the guy above said bc if its in playeradded its going to create a new connection when a player joins which can make it bug out, so just take it out and you will be good.

also, the reason it dosen't stop is because that if statement only runs once, so the debounce dosen't do anything and you should just use promptbuttonholdended

full breach
#

Smthing like this? if so it still continues to play the animation

cold hare
#

say local loadAnim on top of everything

#

then in promptbuyyonbegan set it to loadanimation without "local" keyword

#

and that should work

#

cuz what youre doing now is starting another animation in holdended and stopping it but the other one is still playing

#

@full breach

orchid torrent
#

because all you said was it made no sense and i was just tryna tell him why

full breach
orchid torrent
#

hes saying to just do local LoadAnim at the top and then assign it in the function so just do LoadAnim = humanoid.Animator... because then both functions have the same variable and not 2 seperate ones

full breach
#

i think i understand what youre saying but when i put the loadanim variable at the top the humanoid is underlined red because there is no humanoid variable there

cold hare
#

No

#

At the top just say

#

local loadAnim

#

Don't do = something

#

Just local loadAnim

orchid torrent
#

yeah your just defining it and not setting it equal to anything @full breach

full breach
#

Just like this?

#

if so it still doesnt work

cold hare
#

Did you even read what we said

full breach
#

mb it works now thank you man