kozmo
Member
- Joined
- Jan 30, 2009
- Messages
- 443
- Solutions
- 2
- Reaction score
- 23
Iv tried a bunch of different things to try and make this Event start after 5 minutes of being broadcasted still cannot figure it out..
local function teleportThing(minutes)
local event = 0
if minutes <= 0 then
for _, cid in ipairs(getPlayersOnline()) do
if isInRange(getThingPos(cid), t.fromPos, t.toPos) then
if math.random(1, 3) < 3 then
setPlayerStorageValue(cid, t.redStorage, 1)
doAddCondition(cid, conditionRed)
doTeleportThing(cid, t.redPos, true)
else
setPlayerStorageValue(cid, t.blueStorage, 1)
doAddCondition(cid, conditionBlue)
doTeleportThing(cid, t.bluePos, true)
end
end
end
return true
end
if minutes == 1 then
doBroadcastMessage("Capture The Flag will begin in " .. minutes .. " minute!")
elseif minutes <= 1 then
doBroadcastMessage("Capture The Flag will begin in " .. minutes .. " minutes!")
else
doBroadcastMessage("Capture The Flag will begin in " .. minutes .. " minutes!")
end
event = addEvent(teleportThing, 300, minutes - 1)
return true
end
function onThink(interval, lastExecution)
return teleportThing(math.abs(math.ceil(5)))
end