• 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!

Solved Using repeat

Acubens

Old Penguin
Joined
May 6, 2008
Messages
1,303
Solutions
15
Reaction score
218
Location
Venezuela
I are making a little script using talkactions but this crash my client.

Example:
LUA:
local storage = 5000
local time = 60
local seconds = getPlayerStorageValue(cid,storage) - os.time()


function onSay(cid, words, param)

        setPlayerStorgageValue(storage,os.time()+time)
        if seconds > 1 then
	repeat
		addEvent(doPlayerSendCancel,1000,cid, "Seconds left: "..time.."") -- each 1 second show the value of time 
	until seconds < 1 
	end

return true
end
What is the better method?
 
Last edited:
I are making a little script using talkactions but this crash my client.

Example:
LUA:
local time = getPlayerStorageValue(cid,xxxx) - os.time()

function onSay(cid, words, param)
if time < 1 then
repeat
	addEvent(doPlayerSendCancel,1000,cid, "Seconds left: "..time.."") -- each 1 second show the value of time 
until time < 1 
end

return true
end
What is the real method to do this?

show the entire script
 
that is the script, i edited the first post i was put wrong condition, check now. I need the message appears if time is greater than 1
 
Last edited:
LUA:
local time = getPlayerStorageValue(cid,xxxx) - os.time()
 
function onSay(cid, words, param)
 
	local i = 0
        if time > 1 then
		repeat
			addEvent(doPlayerSendCancel, 1000 * i, cid, "Seconds left: " .. time) -- each 1 second show the value of time
			i = i + 1
			time = time - 1
		until time < 1 
	end
	return true
end
 
Back
Top