Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why isn't my IntValue going down by 1?

I'm mkaing a script/localscript that makes the IntValue go down every 6 seconds. But it dosen't work i don't understand why? code:

while true do

script.Parent.TextLabel.Value.Value = script.Parent.TextLabel.IntValue.Value -1

wait(6)

end

4 comments

0

script.Parent.TextLabel.Value.Value = script.Parent.TextLabel.IntValue.Value?

0

Should not the "IntValue", Be "Value"?

0

It should be a normal script, so if its a local then switch it to regular, if it still doesn't work tell me

0

One of your values are called Value and one is called IntValue one of them are wrong name

1 answer

✓ Accepted answer

script.Parent.TextLabel.Value.Value is going to be one of your issues, there is no property named "Value" when it comes to a TextLabel.

I believe what you mean to say here is, script.Parent.TextLabel.Text This is the property to alter when you are looking to change what's displayed on it.

script.Parent.TextLabel.IntValue.Value -1 is what we are trying to set the text to, which is supposed to be the IntValue in question. This also comes down to IntValue not being a property of a TextLabel. Rather what we need to do here is set it directly to the IntValue.

So rather than what you had:

while true do	
script.Parent.TextLabel.Value.Value = script.Parent.TextLabel.IntValue.Value -1
wait(6)
end

We get something like the following:

local IntValue = 999
while true do
script.Parent.TextLabel.Text = IntValue
IntValue = IntValue - 1
wait(6)
end

For the sake of the example, I created a variable that we lower by 1, every 6 seconds. Then we find the TextLabel in question and set its Text property to the current Value of the IntValue.

This should be able to help you out, if you still have questions let me know!

Links: https://developer.roblox.com/api-reference/class/TextLabel https://developer.roblox.com/api-reference/property/TextLabel/Text

1 comment

0

Thank you :)

This discussion is preserved as it was. New answers, comments, and votes are closed.