Gui is broken after character dies

I have a local script inside starter pack, when i press certain buttons it does things to effect the gui, and it works perfectly fine at first, but after the character dies it completely breaks, some buttons i press wont effect the gui at all, while some won’t effect the gui and will print an error, for example: [NewPart is not a valid member of Frame]. Despite it being a valid member of frame as i have checked while the game is running, how do i fix this?

5 Likes

Could you show your explorer menu of your gui? We need more context to know what is what such as NewPart for the frame?

Do you have ResetOnSpawn enabled? That might be the issue?

5 Likes

what is ResetOnSpawn? no im not familiar with that

If you click on “ScreenGui” in explorer, then go to properties. It will show you ResetOnSpawn.

Edit: What it does is when you reset, if its off, then it wont reset the entire GUI. If enabled, it will reset it, anything changed goes back to normal.

5 Likes

ok i have checked and it is set to true

Try disabling and see what happens? Theres not really enough context to know what your GUI does.

8 Likes

its seems to work now, idk why but changing reset on spawn to false fixed it

Your gui probably had something that changed and needs to be kept changed or it brakes and doesn’t have the same parts. Not reseting the gui is probs what helped.

The PlayerScripts folder (furthermore, StarterPlayerScripts) superseded putting LocalScripts in StarterPack for client-side code, to note.

ResetOnSpawn is also helpful as a property if you don’t want to your Guis to reset after a player dies.

I doubt this is your problem, though you haven’t provided much to work off of, so it’s hard to determine a concrete cause for your problem.

3 Likes