iDannz [Breno]

DestroyElement issue

Recommended Posts

When using destroyElement in GUI widgets, doesnt trigger event onClientMouseLeave if the cursor is inside the destroyed element, please fix 

Share this post


Link to post

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.

 

Share this post


Link to post

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post

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.