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