local events = {} local effects = {} local list = {CONST_ME_EXPLOSIONHIT, CONST_ME_EXPLOSIONAREA, CONST_ME_DRAWBLOOD, CONST_ME_HITBYFIRE, CONST_ME_MORTAREA, CONST_ME_GROUNDSHAKER} local function e(cid, n) if isPlayer(cid) then if n > 0 then doSendMagicEffect(getThingPosition(cid), list[math.random(#list)]) effects[cid] = addEvent(e, 1000, cid, n - 1) end else effects[cid] = nil end return true end function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if not isPlayer(cid) then return true end events[cid] = addEvent(doTeleportThing, 20 * 1000, cid, Position(32319, 32248, 9)) effects[cid] = addEvent(e, 1000, cid, 20) doCreatureSay(cid, 'You must hold the barrier for the next 20 seconds.', TALKTYPE_MONSTER) return true end function onStepOut(cid, item, position, fromPosition) if not isPlayer(cid) then return true end if events[cid] then stopEvent(events[cid]) stopEvent(effects[cid]) doCreatureSay(cid, 'You haven\'t held the barrier for long enough.', TALKTYPE_MONSTER) end return true end