Zcraks Posted March 7, 2019 Share Posted March 7, 2019 I have problem in my script. The created object don't destroyed after "timehour == 6". Sry for my bad English. Help me pls. function chekTime(wind) local timehour, timeminute = getTime(soucre) if(timehour ~= 6 )then wind = createObject(1337,2321.5, -1659.5,13.5) outputChatBox ("Object created") else if (timehour == 6 ) then destroyElement(wind) outputChatBox ("Object destroyed") end end end addEventHandler( "onClientRender", getRootElement( ),chekTime) Link to comment
alexaxel705 Posted May 8, 2019 Share Posted May 8, 2019 (edited) local wind = false function checkTime() local h, _ = getTime() if(h == 6) then if(not isElement(wind)) then wind = createObject(1337,2321.5, -1659.5,13.5) outputChatBox("Object created") end else if(isElement(wind)) then destroyElement(wind) outputChatBox("Object destroyed") end end end addEventHandler("onClientRender", getRootElement(), checkTime) Edited May 8, 2019 by alexaxel705 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