Jump to content

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
  • 2 months later...
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 by alexaxel705
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...