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

How would I make a Gui appear without the person having to reset?

I did

local Blue=workspace.Blue
Blue.ClickDetector.MouseClick:connect(function()
	local Btb=Instance.new("TextButton")
	Btb.Parent=game.StarterGui.ScreenGui
	Btb.Size=UDim2.new(0,70,0,70)
end)

I know I went wrong by putting it under StarterGui since I figured out that it works once you die. Is there a service that makes the Gui appear when you insert it?

1 answer

✓ Accepted answer

What you need to do is edit the GUI inside their PlayerGui.

Luckily, .MouseClick returns a Player instance. So you just need to modify your code like so:

local Blue=workspace.Blue
Blue.ClickDetector.MouseClick:connect(function(player) --ClickDetector.MouseClick returns a Player Instance
	local Btb=Instance.new("TextButton")
	Btb.Parent=player.PlayerGui.ScreenGui -- parent the TextButton to their PlayerGui
	Btb.Size=UDim2.new(0,70,0,70)
end)

Note: This code won't work if you have FilteringEnabled turned on (because the PlayerGui doesn't replicate to the server)

1 comment

0

THank you, that would have never crossed my mind...

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