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?
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)