• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Countdown timer tfs 0.4

Blade33711

Member
Joined
Aug 6, 2012
Messages
133
Solutions
1
Reaction score
5
Location
Poland
Lua:
for x = 0.1, 10 do
        local n = 10 - x
            addEvent(doSendAnimatedText, x * 1000, toPosition, n > 0 and tostring(n), TEXTCOLOR_WHITE)
        end

Why does it subtract 1 and not 0.1?
 
Lua:
for x = 0.1, 10 do
        local n = 10 - x
            addEvent(doSendAnimatedText, x * 1000, toPosition, n > 0 and tostring(n), TEXTCOLOR_WHITE)
        end

Why does it subtract 1 and not 0.1?
the step variable is 1 by default, if you want it to count by 0.1 you would do
Lua:
for i = 0.1, 10, 0.1 do
    --body here
end
 
Back
Top