This script is creating npc in different places every day like Rashid on real Tibia.
Fill config for your positions.Create in data/globalevents/scripts file "npcCreate.lua"
In data/globalevents/globalevents.xml add:
Yours,
Tairens
Fill config for your positions.Create in data/globalevents/scripts file "npcCreate.lua"
Code:
function getDayName()
local days = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}
return days[os.date("*t")["wday"]]
end
local config =
{
respawnPlaces =
{
["Sunday"] = {x =, y = , z =},
["Monday"] = {x =, y = , z =},
["Tuesday"] = {x =, y = , z =},
["Wednesday"] = {x =, y = , z =},
["Thursday"] = {x =, y = , z =},
["Friday"] = {x =, y = , z =},
["Saturday"] = {x =, y = , z =}
},
npcName = "Rashid"
}
function onStartup()
doCreateNpc(config.npcName, config.respawnPlaces[getDayName()])
return true
end
In data/globalevents/globalevents.xml add:
Code:
<globalevent name="npcCreate" type="startup" event="script" value="npcCreate.lua"/>
Yours,
Tairens