tags:

views:

94

answers:

2

I use very simple Lua scripting in an online game called ROBLOX. My problem is that values in my scripts aren't changing! Example:

num = 0
while true do
num = num + 1
print(num)
wait(1)
end

That should count up starting on 0, but the number won't change. Could this be from the ROBLOX website? I can't figure out what else it might be.

+3  A: 

What happens with

local num = 0 
while true do 
    num = num + 1 
    print(num) 
    wait(1) 
end

?

Maybe some other part of the system is changing the global num.

Doug Currie
A: 

I just put your code in the Lua demo and it works fine if you remove the wait() function call. I'm assuming you defined this function somewhere?

Nick