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

How to increase int value?

Asked by
NecoBoss 194
9 years ago
wait(1)
while 1 == 1 do
    script.Parent.Bob.Value = script.Parent.Bob.Value + 1
    wait(1)
end

So this isn't working like I remember (I haven't scripted for months). I haven't been able to change any values for anything including booleans. I must be screwing up something but I don't know what.

2 answers

Log in to vote
1
Answered by 9 years ago

Try doing this, it should owrk

wait(1)
while wait(.5) do
script.Parent.Bob.Value = script.Parent.Bob.Value + 1
end
0
Nope. Doesn't work. :P Is it because I'm trying to change an int value? NecoBoss 194 — 9y
0
it shouldnt matter ,but try using a number value also. Also what type of script is it in? koolkid8099 705 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

Maybe it's not finding that it exists try a :WaitForChidl()

local value = script.Parent:WaitForChild("Bob")

while true do

wait(3) -- How long you want it to wait before adding 1 to the value

value.Value = value.Value + 1

end

Answer this question