Hello, I am trying to write a function.
Function: /restart
Procedure:
1.saveall
2.chat message ...
3.Function should wait 15 seconds
then
4.shutdownserver
here is my idea:
[lua] elseif cmd[1] == "/restart" then
if not event.player:isAdmin() then return msgAccessDenied(event.player) end
restart(event.player);[/lua]
[lua]function restart(player)
server:saveall
player:sendTextMessage("Der Server wird in 15sec restartet ")
sleep(15)
server:shutdownserver
end[/lua]
can someone help me?
thx and sry for my bad english