strutZ
Australian OT Member {AKA Beastn}
- Joined
- Nov 16, 2014
- Messages
- 1,393
- Solutions
- 7
- Reaction score
- 552
Hey there,
So I'm just experimenting with loops and i was wondering if someone could help me with this? Idea is to continually say 'AFK' if storage value is = to 1 BUT i want a 3 second delay before it goes through the loop again so it doesnt spam. (Like animated text)
So I'm just experimenting with loops and i was wondering if someone could help me with this? Idea is to continually say 'AFK' if storage value is = to 1 BUT i want a 3 second delay before it goes through the loop again so it doesnt spam. (Like animated text)
Code:
--CONFIG--
local afkactive = 808012 -- Assign a unsued storage
--END CONFIG--
function onSay(cid, words, param)
local player = Player(cid)
while(player:getStorageValue(afkactive) == 1)
do
if player:getStorageValue(748596123) < os.time() then
player:setStorageValue(748596123, os.time() + 3)
player:say('AFK', TALKTYPE_MONSTER_SAY)
end
end
end