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
Moderators IIYAMA Posted March 7, 2019 Moderators Share Posted March 7, 2019 (edited) if timehour == 6 then if wind and isElement(wind) then destroyElement(wind) wind = nil outputChatBox ("Object destroyed") end elseif not wind or not isElement(wind) then wind = createObject(1337,2321.5, -1659.5,13.5) outputChatBox ("Object created") end @Zcraks Edited March 7, 2019 by IIYAMA Link to comment
Zcraks Posted March 7, 2019 Author Share Posted March 7, 2019 26 minutes ago, IIYAMA said: @Zcraks Object is not created Link to comment
Moderators IIYAMA Posted March 7, 2019 Moderators Share Posted March 7, 2019 35 minutes ago, Zcraks said: Object is not created then it is: if timehour == 6 then or not executed at all. Link to comment
Zcraks Posted March 7, 2019 Author Share Posted March 7, 2019 (edited) Thank You Edited March 7, 2019 by Zcraks Problem solved. Link to comment
Moderators IIYAMA Posted March 7, 2019 Moderators Share Posted March 7, 2019 4 minutes ago, Zcraks said: How to do it ? ... what do you do? 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