• 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 Rashid DAY SCRIPT

Discovery

Developing myself
Joined
Apr 16, 2010
Messages
562
Solutions
11
Reaction score
260
Location
Neverland
i need to fixed this script :/

[Error - GlobalEvent Interface ]
data/globalevents/scripts/rashid.lua:onStartup
Description:
<LuaInterface::luaDoCreateNpc> Cannot create npc: Rashid

LUA:
function onStartup()

        local Dia = os.date("%A")
        if Dia == "Monday" then
                RashidPos = {x = 32206, y = 31155, z = 7}
        elseif Dia == "Tuesday" then -- Terça-Feira
                RashidPos = {x = 32302, y = 32834, z = 7} 
        elseif Dia == "Wednesday" then -- Quarta-Feira
                RashidPos = {x = 32579, y = 32753, z = 7} 
        elseif Dia == "Thursday" then -- Quinta-Feira
                RashidPos = {x = 33066, y = 32876, z = 6} 
        elseif Dia == "Friday" then -- Sexta-Feira
                RashidPos = {x = 33227, y = 32481, z = 7} 
        elseif Dia == "Saturday" then -- Sabado
                RashidPos = {x = 33171, y = 31814, z = 6} 
        elseif Dia == "Sunday" then
                RashidPos = {x = 32328, y = 31783, z = 6} 
        end
        
        doCreateNpc("Rashid", RashidPos)
        
end
 
Last edited by a moderator:
Edit positions
LUA:
local days =
{
	[1] = {x = 32328, y = 31782, z = 6}, --Sunday // Domingo
	[2] = {x = 32207, y = 31155, z = 7}, --Monday // Lunes
	[3] = {x = 32300, y = 32837, z = 7}, --Tuesday // Martes
	[4] = {x = 32577, y = 32753, z = 7}, --Wednesday // Miercoles
	[5] = {x = 33066, y = 32879, z = 6}, --Thursday // Jueves
	[6] = {x = 33235, y = 32483, z = 7}, --Friday // Viernes
	[7] = {x = 33166, y = 31810, z = 6} --Saturday // Sabado
}

local day = os.date("*t").wday
if days[day] then
	doCreateNpc("Rashid", days[day])
else
	print("[!] -> Cannot create Rashid. Day: " .. day .. ".")
end

If you get an error, check if npc Rashid exists in your server.
 

Similar threads

Back
Top