Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it possible to completely remove something from the PlayerGui?

Asked by 6 years ago
Edited 6 years ago

I have a surface gui with an adornee of a brick in the workspace. I want to get rid of it using a script that channels through the playergui and deletes it in there. I do that and it gets rid of it, but when the player resets it comes back, and it will come back no matter what i try. Is getting rid of it even possible?

I have asked this before but I actually haven't found a solution yet.

If there was a OnSpawn or OnReset event or function or whatever, I could use that. But I don't know what I could use

0
Sorry about that, I tried greatneil80 2647 — 6y
0
surfacegui:Destroy()?? greatneil80 2647 — 6y
0
it comes back MusicalDisplay 173 — 6y
0
its in playergui MusicalDisplay 173 — 6y

1 answer

Log in to vote
1
Answered by
cailir 284 Moderation Voter
6 years ago
Edited 6 years ago

Hello, Red_Musician!

If I understood well, you want to remove a component with scripts, right?

Thats easy:

--Lets create a part just to have something to remove...
Instance.New("Part").Parent = game.Workspace

--Now lets destroy it

game.Workspace.Part:Destroy() -- game.Workspace.Part = Find the part with scripts :Destroy() = Remove the part

The ":Destroy()" method can be used to destroy anything... A player, a part(same as the example), A Gui...

If you want to disable a GUI when the player die and it don't apear anymore just disable "Reset on spawn" on the GUI

Good luck with your games!

0
Yes, I understand how to remove instances from anything, but this is different. I have already removed it with :Destroy(), but it returns as if nothing had happened when the player resets. I am wondering if you can keep it destroyed. If you want to know what im talking about, try it yourself MusicalDisplay 173 — 6y
1
If you want to disable a GUI when the player die and it don't apear anymore just disable "Reset on spawn" on the GUI cailir 284 — 6y
0
Im using a surface gui MusicalDisplay 173 — 6y
Ad

Answer this question