There are few cases where you'll need to manipulate GUI's within StarterGui. The StarterGui's purpose is to replicate GUIs to the PlayerGui, which is where all the UI is stored that a user can see.
Your code has three main issues:
1) You are attempting to edit a GUI within StarterGui, not PlayerGui
2) You never find the Player who touched so you may access PlayerGui
3) Assuming this is a Script, you cannot access PlayerGui without using a RemoteEvent or RemoteFunction
The below fixes are based on the above issues. You will need to add a RemoteEvent to ReplicatedStorage and name it "EnableGui" and add a localscript to PlayerGui inside of the GUI you are enabling.
-Script
1 | local EnableGui = game.ReplicatedStorage:WaitForChild( "EnableGui" ) |
3 | if hit.Parent:FindFirstChild( "Humanoid" ) then |
4 | EnableGui:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent)) |
8 | script.Parent.Touched:Connect(Touch) |
-localscript
1 | local EnableGui = game.ReplicatedStorage:WaitForChild( "EnableGui" ) |
3 | EnableGui.OnClientEvent:Connect( function () |
4 | script.Parent.Enabled = true |
If you have any issues or questions, then feel free to comment below.