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
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
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
Thank you :)
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
script.Parent.TextLabel.Value.Value = script.Parent.TextLabel.IntValue.Value?
Should not the "IntValue", Be "Value"?
It should be a normal script, so if its a local then switch it to regular, if it still doesn't work tell me
One of your values are called Value and one is called IntValue one of them are wrong name