• 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 leave party

mmheo

New Member
Joined
Sep 14, 2017
Messages
157
Reaction score
1
hello guys i use 0.4
how i can make if player leave party get tp to temple
 
I have no idea why you want this, but the solution I came up with was so funny in my head I couldn't bare not to create it.

So the main problem with your idea is that there is no creatureevent that triggers via party
Lua:
"login"
"logout"
"joinchannel"
"leavechannel"
"advance"
"sendmail"
"receivemail"
"traderequest"
"tradeaccept"
"textedit"
"reportbug"
"look"
"think"
"direction"
"outfit"
"statschange"
"areacombat"
"push"
"target"
"follow"
"combat"
"attack"
"cast"
"kill"
"death"
"preparedeath"
So the only other thing that we can do is check all of the players online and verify whether or not they are in a party, and once they are in a party, then you need to check when they aren't in one, and teleport them to the temple.

If it was impossible to logout while in a party we wouldn't require a storage_value at all, but 🤷‍♂️

remember to register in creaturescripts and login.lua
Lua:
local party_storage = 45001

local function partyCheck(cid, party)
    if not isPlayer(cid) then
        return true
    end
    if party = 0 and isInParty(cid) then
        party = 1
        doCreatureSetStorage(cid, party_storage, 1)
    elseif party = 1 and not isInParty(cid) then
        party = 0
        doCreatureSetStorage(cid, party_storage, 0)
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
    end
    addEvent(partyCheck, 500, cid, party)
end

function onLogin(cid)
    if getCreatureStorage(cid, party_storage) == 1 then
        doCreatureSetStorage(cid, party_storage, 0)
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
    end
    addEvent(partyCheck, 500, cid, 0)
    return true
end
 
Back
Top