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

Lua Teleport players if have StorageID

Mr Erimyth

Member
Joined
Apr 8, 2009
Messages
163
Reaction score
11
Location
Brazil
Hello Boys... anyone can help me ? i work in new event...
and i cant remove players from area event.

anyone can help me ?
If Function Endevent remove players fron area ?

Code:
function doCloseExf()

setGlobalStorageValue(configExf.stats, -1)
addEvent(removeEventTeleport, 1 * 1000, TELEPORT_POSITION)
end

I need check all payers online have storageID 24112017, 1 is teleported to Temple. and remove storage to ( 0 )

Thxx broww...
 
Solution
I think you can add this MOD, test it:

Lua:
<mod name="KickPlayersWithValue" version="1.0" author="Lokolokio" contact="[email protected]" enabled="yes">
    <config name="kickPlayers">
    <![CDATA[
        config = {
            pos = {x = XXXX, y = YYYY, z = Z}
        }
    ]]>
    </config>
    <globalevent name="kickPlayers" interval="1000" event="script">
    <![CDATA[
        domodlib("kickPlayers")
function onThink(interval, lastExecution)
    local list = getPlayersOnline()
    if (#list == 0) then
        return true
    end 
    for _, cid in pairs(list) do
        if getPlayerStorageValue(cid, 24112017) == 1 then --I think this value is 1
            doTeleportThing(cid, config.pos)...
Just going to add my $0.02 in.

You'll probably want a secondary check somewhere, so people who are offline will have their storage reset at some point as well.
Otherwise the next time this event is run, those players may be teleported from their hunting spots et cetera.

(or only teleport players who are still inside the event area.)
 
I think you can add this MOD, test it:

Lua:
<mod name="KickPlayersWithValue" version="1.0" author="Lokolokio" contact="[email protected]" enabled="yes">
    <config name="kickPlayers">
    <![CDATA[
        config = {
            pos = {x = XXXX, y = YYYY, z = Z}
        }
    ]]>
    </config>
    <globalevent name="kickPlayers" interval="1000" event="script">
    <![CDATA[
        domodlib("kickPlayers")
function onThink(interval, lastExecution)
    local list = getPlayersOnline()
    if (#list == 0) then
        return true
    end 
    for _, cid in pairs(list) do
        if getPlayerStorageValue(cid, 24112017) == 1 then --I think this value is 1
            doTeleportThing(cid, config.pos)
            setPlayerStorageValue(cid, 24112017, -1)
        end
    end
    return true
end
    ]]>
</globalevent>
</mod>

Kind Regards :D
 
Solution
Back
Top