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

How to make a GUI be destroyed (Part2)?

local Message1 = game.StarterGui.Message
function Delete()
Message1.BackgroundTransparency = 1
Message1.TextTransparency = 1
end
 wait(10)
Delete()

I finished up with this code, It is located inside a Gui at StarterGu, where should I insert it and there is any problem with the code cause it's not working. PS: It is a local script.

1 answer

✓ Accepted answer

The answer is really simple, you're editing (Or deleting) it in StarterGui not PlayerGui

When a player spawns, everything in StarterGui goes into PlayerGui (A child of the Player)

So when you say

local Message1 = game.StarterGui.Message
function Delete()
Message1.BackgroundTransparency = 1
Message1.TextTransparency = 1
end
 wait(10)
Delete()


It's changing the transparency of the Message in the StarterGui, which will not show up in any player's PlayerGui.

What you should do is put the script in the "Message" and just make the script say:


function Delete()
script.Parent.BackgroundTransparency = 1
script.Parent.TextTransparency = 1
end
 wait(10)
Delete()


Now, I'm not sure what the goal of your code is. If you're trying to change the GUI in every player at the same time, you have to do something different, but this is assuming its just when the player spawns, it will wait 10 seconds, then start the Delete function.

1 comment

0

Thank You!

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