Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

when You die, does all of the player GUI Event's Disconnect?

Say For Instance I made A MouseButton1Click Event for the player to click on the Client

When You die, does that Event Get Disconnected? Is there a list of events I can see connected?

2 comments

0

What do you mean by "Disconnected"?

0

When you create an event like A mouse Click Event, Its listening for when the mouse clicks so It can do the function within that event. But Declaring too many Events will take a lot game resources and will create game deficiency or probably lag. Thats why we must disconnect events when We dont need them any more. They can be done by doing Event:Disconnect()

1 answer

✓ Accepted answer

When an Instance is destroyed, the parent property of the Instance is set to nil. After that the Parent property is locked. Then all the connections to any of the Instance's events are disconnected.

If you have ResetOnSpawn enabled on the ScreenGui, then the ScreenGui and all of its descendants will be destroyed. Otherwise they will stay the connected.

1 comment

0

Oh Thank you very Much! I didnt know that on death that all of the descendants inside GUI would be destroyed. I will now Accept your answer! :D !

This discussion is preserved as it was. New answers, comments, and votes are closed.