#Stamina Bar won't change

1 messages · Page 1 of 1 (latest)

proper oracle
#

hey, just making a stamina bar, but i'm having some issues

so basically, i'm having it when the player presses shift, an event is called for the server to calculate the player running. the server would then ping back to the client for the stamina bar, and etc. not the greatest, as i'll probably have to do it on both client and server if i want it to be responsive, but i wanna fix this issue first

don't wanna overexplain it, since i'll post the code, but for some reason, stamina stays at 99? i was sure to change it at the actual source, but it doesn't seem to do anything

here's the server script
https://www.codedump.xyz/lua/acsyEESoN1T67sOb

the client script is working fine, as i've tested. the hooks activate, it's just the for loop i'm trying to figure out why it's not working

humble mistBOT
#

studio** You are now Level 2! **studio

proper oracle
#

also, i've been finding there's a lot of lines of code that are just

    local character = player.Character
    local statFolder = character:WaitForChild("Stats")
    local stamina = statFolder.Stamina.Value
    local running = statFolder.Running.Value

which seems kinda redundant, but i don't know if there's a way to shorthand that or not

long haven
#

I think this line is the problem cuz it just changes the variable in script and not the actual value

stamina -= useStamina

Change it to

statFolder.Stamina.Value -= useStamina
long haven