script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then game.StarterGui.ScreenGui.Frame.Visible = true end end)
A server script cannot access PlayerGui but a localscript can so you will need to insert a remote event into Replicated Storage and insert a localscript into ScreenGui and put this code inside of the server script
script.Parent.Touched:Connect(function() if hit.Parent:FindFirstChild("Humanoid") then local Player = game.Players:GetPlayerFromCharacter(hit.Parent) game.ReplicatedStorage.RemoteEvent:FireClient(Player) end end)
and put this code into the localscript
game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function() game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.Visible = true end)