Jump to content

DestroyElement issue


Recommended Posts

  • Moderators
Posted

If something doesn't exist anymore, then there is nothing to leave from.

In fact it will only cause more problems for the onClientMouseLeave event. An event can't just trigger without it's source.

 

Posted

I use it to check if localplayers cursor is inside gui, i add event to mouse enter, and setup variable to true, and on mouseleave change the variable to false, but if the cursor is inside gui, and the gui get destroyed, the event isnt triggered, any other way to do it different to this?

Im using if variable then variable = false end

Before destroying the gui

  • Moderators
Posted (edited)
17 minutes ago, xDxD said:

I use it to check if localplayers cursor is inside gui, i add event to mouse enter, and setup variable to true, and on mouseleave change the variable to false, but if the cursor is inside gui, and the gui get destroyed, the event isnt triggered, any other way to do it different to this?

Im using if variable then variable = false end

Before destroying the gui

 

Set variable to false before destroyElement is fine.

Edited by stPatrick
  • Moderators
Posted
21 minutes ago, xDxD said:

I use it to check if localplayers cursor is inside gui, i add event to mouse enter, and setup variable to true, and on mouseleave change the variable to false, but if the cursor is inside gui, and the gui get destroyed, the event isnt triggered, any other way to do it different to this?

Im using if variable then variable = false end

Before destroying the gui

Instead of true save the gui element you entered. Then you can compare it to the destroyed element later.

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...