Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't my IntValue going down by 1?

Asked by 5 years ago
Edited 5 years ago

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
0
script.Parent.TextLabel.Value.Value = script.Parent.TextLabel.IntValue.Value? Lava_Scripter 109 — 5y
0
Should not the "IntValue", Be "Value"? Lava_Scripter 109 — 5y
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 jotishk 0 — 5y
0
One of your values are called Value and one is called IntValue one of them are wrong name misterviggo 61 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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

0
Thank you :) Freddan2006YT 88 — 5y
Ad

Answer this question