Generating random values doesn't work

Where are you using the value? If it’s in a server script, it won’t be updated because you’re using a LocalScript to change it.

It is a local script, and… i put it inside the value.

Yes, you’re changing it with that… You never use the value within that script.

Have you tried to turn the number into a string? You seem to be setting the textLabel’s text to a number, you might want to use “tostring” before setting the text,

so wrap the Value.Value in a tostring

That works completely fine, it will automatically convert the type, you can even concatenate numbers directly to strings.

I’m also not the OP having an issue with his code.

That’s not a sensible solution. It doesn’t matter if the value is a string OR a number.

Have you tried adding a print to your loop yet? This is the first step of debug.

Add this below where you set the Value.Value to math.random(1,3)

print(value.Value)
1 Like

So you want me to put the value into the script instead of it being the script’s parent? If that’s so, i didn’t work either

oh hey somehow that actually work, lemme try some stuff in the main script and the conclusion will come quickly.

No? You are NOT using the value. You’re only setting the Value, and nothing else. You’re not setting any textlabel’s text to it, you’re not using it for anything within your status effect script you provided earlier, so I’m failing to understand where you’re using the value.

Also, If you’re checking the value within StarterGui as well, it will always be 0.

Check the PlayerGui and not StarterGui

1 Like

Yes it is working, i’m not very good at scripting so sorry for bothering and wasting everyone’s times. Thank you and everyone for helping me

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