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

How to increase int value?

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

✓ Accepted answer

Try doing this, it should owrk

wait(1)
while wait(.5) do
script.Parent.Bob.Value = script.Parent.Bob.Value + 1
end

2 comments

0

Nope. Doesn't work. :P Is it because I'm trying to change an int value?

0

it shouldnt matter ,but try using a number value also. Also what type of script is it in?

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

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