Attempt to perform arithmetic (div) on string, stamina bar tweening problems

Working on a stamina system, problem is Im pretty new, I have been struggling with my stamina systems and bars, sometimes, I will get it to work but make a mistake and cant redo what I did.

PROBLEM:

script,

how i executed the function
image

script location,
image

I exactly dont know how its a problem, since sometimes it doesnt show the error but most of the times the error is there

please help

1 Like

Note: I added the percval to try if the error will still show up, but I guess that it still doesnt work
originally, percval isnt there but when i screenshotted i was in the middle of trying it.

1 Like

I found it out. Stamina simply had no value

2 Likes

You should probably change this to scripting support.

seems like your value objects are string values instead of number values so try replacing those. You could also use Stamina.Changed to update the ui instead of a while loop

Stamina.Changed:Connect(updateUI)

5 Likes

ohhhh thats such a great idea, Thanks!

sorry im pretty new in the community, thanks for your help though!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.