lua event

05/01/2018 15:26 Engelchen89#1
ich habe eine frage wie mache ich das in der lua das er an einem bestimmten tag und zeit zb ein buff aktiviert oder beendet aktuell habe ich das so stehen

local current_time = get_os_date( "%Y-%m-%d %H:%M:%S" )
local event_start = '2018-05-01 15:19:00'
local event_end = '2018-05-01 15:20:00'


if current_time > event_start or current_time > event_end then

if current_time > event_start and current_time < event_end then

add_event_state(314012,1)
announce("Der Server Buff wurde Aktiviert")

elseif current_time < event_end then

remove_event_state(314012,1)
announce("Der Server Buff wurde entfernt")


else

announce("Da hat was nicht geklappt, bitte Pruefen")
end

end
05/03/2018 11:40 solo69#2
hmmm i hope i got what you mean

you can implement this lua in a function and then you can call this function in on_login.lua whenever a player login the function will be called or in the telecaster there is a table to call a function every period of time
05/03/2018 12:46 ThunderNikk#3
But theirs will not work I think that is why they asked for help.

There is no...

if

if

do

else

do

else

do

There is only...

if

do

else

do

They are looking for someone to make it work.
05/05/2018 10:07 Perona2#4
Das würde mich auch interessieren da ich jetzt bei den Events einstellungen bin.

Einer eine Idee ??
05/07/2018 14:53 Wuthnex#5
Quote:
Originally Posted by ThunderNikk View Post
But theirs will not work I think that is why they asked for help.

There is no...

if

if

do

else

do

else

do

There is only...

if

do

else

do

They are looking for someone to make it work.
Sonnst alles gesund?
05/07/2018 16:27 thefear511#6
Quote:
Originally Posted by Engelchen89 View Post
ich habe eine frage wie mache ich das in der lua das er an einem bestimmten tag und zeit zb ein buff aktiviert oder beendet aktuell habe ich das so stehen

local current_time = get_os_date( "%Y-%m-%d %H:%M:%S" )
local event_start = '2018-05-01 15:19:00'
local event_end = '2018-05-01 15:20:00'


if current_time > event_start or current_time > event_end then

if current_time > event_start and current_time < event_end then

add_event_state(314012,1)
announce("Der Server Buff wurde Aktiviert")

elseif current_time < event_end then

remove_event_state(314012,1)
announce("Der Server Buff wurde entfernt")


else

announce("Da hat was nicht geklappt, bitte Pruefen")
end

end
search NPC_event_WD_2014_worldcup_contact()
in Npc_event.lua, best lua teacher is the lua itself.
05/07/2018 21:58 Wuthnex#7
Quote:
Originally Posted by thefear511 View Post
search NPC_event_WD_2014_worldcup_contact()
in Npc_event.lua, best lua teacher is the lua itself.

Das ist ein NPC bezogenes Event. Jeden Tag zB. ein anders Item.
05/07/2018 22:00 Engelchen89#8
Genau ein npc bezogenes event meine ich nicht sondern das zb montags um sagen wir mal 13 uhr startet ein zufälliges event entweder ein buff oder exp event und an mittwoch zb um 13 uhr endet das wieder
05/13/2018 15:50 thefear511#9
PHP Code:
function on_server_init()
    
roaming()
    
rare_mob()
    
guardian_spawn()
    
random_respawn()
    
add_global_prop()
    
for_event_by_liveteam() 
    
    
add_random_tiamat_monster()
    
add_random_tiamat_monster()
    
add_random_tiamat_monster()
    
    
local current_time get_os_date"%Y-%m-%d %H:%M:%S" )
    
local event_end '2016-01-25 00:01:00'
    
if  current_time event_end then
        set_env
("game.exp_rate",1.5)
        
set_env("game.chaos_drop_rate",4.5)
    else
        
set_env("game.exp_rate",1)
        
set_env("game.chaos_drop_rate",3)
    
end
end 
i found this somewhere in my files its in server_int.lua