StarterGui and PlayerGui; Not the Same
Some beginners may find this to be a quick way to change a Gui for all players. Unfortunately, it's not that simple. StarterGui is basically what PlayerGui clones from when you respawn. That means, any changes you make to objects in StarterGui will not show until you respawn.
So what you were doing was changing the visibility of the GUI in StarterGui, not the players GUI.
You should handle the Touched event on the client, and check if it's them who touched it. Place the LocalScript
somewhere where local scripts will execute in, like PlayerScripts
.
01 | local Brick = game.Workspace.Part |
02 | local client = game:GetService( "Players" ).LocalPlayer |
04 | Brick.Touched:Connect( function (part) |
05 | if part:IsDescendantOf(client.Character) then |
06 | client.PlayerGui.TT.Frame.Visible = true |
07 | Brick.Transparency = 1 |
08 | game.Workspace.TLine.Transparency = 0.5 |
source