Jump to content

destroyElement


Zcraks

Recommended Posts

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
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 by IIYAMA
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...