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

How to make a GUI be destroyed (Part2)?

Asked by 7 years ago
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

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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.

0
Thank You! ArcanZus 61 — 7y
Ad

Answer this question