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

Event kickout

Fiester

New Member
Joined
Aug 30, 2022
Messages
22
Reaction score
2
Hey guys have any question i got pay exp for gold ingots
but i need to add time kick like

addEvent(kickOut, 1000 * 60 * 60, cid) for 1 hour

my script is

Lua:
function onUse(cid, item, frompos, item2, topos)
tppos = {x=1039, y=108, z=14, stackpos=255}
if doPlayerRemoveItem(cid, 9971, 15) then
doTeleportThing(cid, tppos)
doSendMagicEffect(getPlayerPosition(cid), 30)
else
doPlayerSendCancel(cid, "Nie masz przy sobie 15 gold ingots.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return true
end
 
Lua:
local function kickOut(cid)
    local pos = {x=1039, y=108, z=14, stackpos=255}
    local player = Player(cid)
    if player then
        doTeleportThing(cid, pos)
    end
end

function onUse(cid, item, frompos, item2, topos)
    local tppos = {x=1039, y=108, z=14, stackpos=255}
    if doPlayerRemoveItem(cid, 9971, 15) then
        doTeleportThing(cid, tppos)
        doSendMagicEffect(getPlayerPosition(cid), 30)
        addEvent(kickOut, 1000 * 60 * 60, cid)
    else
        doPlayerSendCancel(cid, "Nie masz przy sobie 15 gold ingots.")
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
    return true
end
 
Change
addEvent(kickOut, 1000 * 60 * 60, cid)
to
addEvent(kickOut, 10000, cid)

and tell me if it works or not and check console
 
console:
data/actions/scripts/payexp/1.lua:3: attempt to call global 'Player' (a nil value)
stack traceback:
data/actions/scripts/payexp/1.lua:3: in function <data/actions/scripts/payexp/1.lua:1>
 
now is work :) thanks

Lua:
local function kickOut(cid)
    local pos = {x=160, y=50, z=7, stackpos=255}
    local player = isCreature(cid)
    if player then
        doTeleportThing(cid, pos)
    end
end

function onUse(cid, item, frompos, item2, topos)
    local tppos = {x=1039, y=108, z=14, stackpos=255}
    if doPlayerRemoveItem(cid, 9971, 15) then
        doTeleportThing(cid, tppos)
        doSendMagicEffect(getPlayerPosition(cid), 30)
        addEvent(kickOut, 1000 * 60 * 1, cid)
    else
        doPlayerSendCancel(cid, "Nie masz przy sobie 15 gold ingots.")
        doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end
    return true
end
 
Back
Top