Zcraks Posted March 7, 2019 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)
Moderators IIYAMA Posted March 7, 2019 Moderators 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
Zcraks Posted March 7, 2019 Author Posted March 7, 2019 26 minutes ago, IIYAMA said: @Zcraks Object is not created
Moderators IIYAMA Posted March 7, 2019 Moderators 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.
Zcraks Posted March 7, 2019 Author Posted March 7, 2019 (edited) Thank You Edited March 7, 2019 by Zcraks Problem solved.
Moderators IIYAMA Posted March 7, 2019 Moderators Posted March 7, 2019 4 minutes ago, Zcraks said: How to do it ? ... what do you do?
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