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

Error With MOD Map Change

yeltsing

New Member
Joined
Jul 12, 2008
Messages
60
Reaction score
0
I use this for my war scrit enforce and gives me an error this is scrit


<?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,5,3}, -- townids to teleport to.
storage = 3454, -- number to store map status in.
changetime = 900 -- time to change in seconds (change in globalevents too)
}
]]></config>
<event type="login" name="Map Login" event="script"><![CDATA[
loadmodlib('mapchange_config')
function onLogin(cid)
doPlayerSetTown(cid, getGlobalStorageValue(config.storage))
doTeleportThing(cid, getPlayerMasterPos(cid))
return true
end
]]></event>
<globalevent name="Map Change" interval="900" event="script"><![CDATA[
domodlib('mapchange_config')
function onThink(interval, lastExecution, thinkInterval)
repeat
RDM = math.random(1,#config.temples)
until RDM ~= getGlobalStorageValue(config.storage) and isInArray(config.temples, RDM)
if getWorldCreatures(0) > 0 then
for _, pid in ipairs(getPlayersOnline()) do
if getPlayerAccess(pid) < config.access and getPlayerAccountManager(pid) == MANAGER_NONE then
doPlayerSetTown(pid, config.temples[RDM])
doTeleportThing(pid, getTownTemplePosition(config.temples[RDM]), false)
doSendMagicEffect(getCreaturePosition(pid), 37)
doCreatureAddHealth(pid, getCreatureMaxHealth(pid))
doCreatureAddMana(pid, getCreatureMaxMana(pid))
doRemoveConditions(pid, FALSE)
end
doBroadcastMessage("Round over. Map switched to " ..getTownName(config.temples[RDM]).. ".", MESSAGE_EVENT_ADVANCE)
setGlobalStorageValue(config.storage, config.temples[RDM])
end
else
print ("[MAP] No players online, aborting map change!")
end
return true
end
]]></globalevent>
</mod>


And the error is this help my plis creaturescrit is an error when you try to enter a player


[12/09/2010 07:52:44] [Error - CreatureScript Interface]
[12/09/2010 07:52:44] buffernLogin
[12/09/2010 07:52:44] Description:
[12/09/2010 07:52:44] [string "loadBuffer"]:3: attempt to index global 'config' (a nil value)
[12/09/2010 07:52:44] stack traceback:
[12/09/2010 07:52:44] [string "loadBuffer"]:3: in function <[string "loadBuffer"]:2>
 
Back
Top