WiBox Posted May 29, 2018 Share Posted May 29, 2018 local Time1 = 3600000 function event () function timer() setTimer( function() if Time1 >= 0 then Time1 = Time1 -3000 for _,all in ipairs ( localPlayer ) do outputChatBox("The event will start every one hour once. TimeLeft:"..Time1.." miliseconds(1000 = 1 second).", all, 0, 255, 0) end timer() end end, 600000, 0 ) end end addEventHandler("onResourceStart", root, timer ) Please? can someone fix it? I already tried using in console " debugscript 3 " fixed all bugs but still not working.. any help? I just need to fix this code, and if I made it wrong, from this code I need that each 10 minutes message will be send for all players that the event will start each 1 hour, each 10 minutes i want the message get send and first time said {50 minutes left... 40 minutes left... 30 minutes lefts... 20 minutes left... 10 minutes left.... 0 minutes left...} i want those minutes on ..Time1.. place each 10 minutes it will say how much left... I appreciate for who help me. Even if he at least try to Link to comment
Z4Zy Posted May 29, 2018 Share Posted May 29, 2018 Try this out. May be it'll good. function event () local Time1 = 50 for _,all in ipairs ( getElementsByType("player") ) do outputChatBox( "Event Will Started In 60 Minutes. #ff0000TimeLeft:- #00ff0060 Minutes", all, 255, 255, 0, true ) end eventTimer = setTimer( function() if Time1 > 0 then for _,all in ipairs ( getElementsByType("player") ) do outputChatBox("The event will start every one hour once. TimeLeft: "..Time1.." Minutes", all, 0, 255, 0) end Time1 = Time1 - 10 else for _,all in ipairs ( getElementsByType("player") ) do outputChatBox("Event Started !", all, 255, 255, 0) end killTimer(eventTimer) end end, 600000, 0 ) end addEventHandler("onResourceStart",resourceRoot,event) 1 Link to comment
WiBox Posted May 30, 2018 Author Share Posted May 30, 2018 Thank you, I appreciate you're help! I'll try it. Link to comment
WiBox Posted May 30, 2018 Author Share Posted May 30, 2018 Thanks! It worked, I just need to add the time as I need. I appreciate you're help thanks so much ~ Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now