Hello, well as title say, i have a change map mod, its all working, but it doesn't remove the PZ and i get an error.
Mod:
Error:
Hope someone can help me.
also ill give rep.
Mod:
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Map Change" version="2.0" author="Syntax" contact="[email protected]" enabled="yes">
<description>
This should teleport all players to a new random town in intervals.
</description>
<config name="mapchange_config"><![CDATA[
config = {
access = 3, -- minimum access to bypass teleportation.
temples = {1,2,3} --townids to teleport to.
}
]]></config>
<event type="login" name="Map Login" event="script"><![CDATA[
function onLogin(cid)
doPlayerSetTown(cid, getGlobalStorageValue(3454))
doTeleportThing(cid, getPlayerMasterPos(cid))
return true
end
]]></event>
<globalevent name="Map Change" interval="10" event="script"><![CDATA[
domodlib('mapchange_config')
function onThink(interval, lastExecution, thinkInterval)
repeat
RDM = math.random(1,#config.temples)
until RDM ~= getGlobalStorageValue(3454) and isInArray(config.temples, RDM)
for _, pid in ipairs(getPlayersOnline()) do
if getPlayerAccess(pid) < config.access then
doPlayerSetTown(pid, config.temples[RDM])
doTeleportThing(pid, getTownTemplePosition(config.temples[RDM]), false)
doSendMagicEffect(getCreaturePosition(pid), 37)
doRemoveCondition(cid, CONDITION_INFIGHT)
doCreatureAddHealth(pid, getCreatureMaxHealth(pid))
doCreatureAddMana(pid, (getCreatureMaxMana(pid) - getCreatureMana(pid)))
setGlobalStorageValue(3454, config.temples[RDM])
end
end
return true
end
]]></globalevent>
</mod>
Error:
Hope someone can help me.
also ill give rep.