function startupEvent()
if(getGameState() == GAMESTATE_NORMAL) then
if(getGlobalStorageValue(10001) == -1) then
setGlobalStorageValue(10001, 1)
onServerStart()
addEvent(setGlobalStorageValue, 3000, 10001, -1)
end
else
addEvent(startupEvent, 1000)
end
end
startupEvent()
function onServerStart()
--here you can place whatever you want
--will be executed at server start
print('Server loaded..')
end
Sure, but it works only at first startskawkens said:if(getGlobalStorageValue(10001) == -1) then
setGlobalStorageValue(10001, 1)
onServerStart()
end
Sure, but it works only at first start![]()
@function onTopic()
print('Updated!')
return POST_NEW_REPLY
end
use npc! make a xml npc, which loads a script. do whatever you want in a BLANK script file, no functions. this will only load when you start the server, and when you reload npcs. so if you dont reload npcs, you have a prefect startup script