lua
script.Parent.Touched:Connect(function()
game.StarterGui.ScreenGui.Frame.BackgroundTransparency = 1
wait(5)
game.StarterGui.ScreenGui.Frame.BackgroundTransparency = 0
end)
There are 2 things wrong with what you wrote:
You're changing the StarterGui which will only show changes in your UI when you reset, or join the game. You want to change the PlayerGui of the person who touched the brick (I'm guessing).
-- You probably would want to do something like this player.PlayerGui.ScreenGui.OtherUiStuff
Assuming your script is on the Server Side, you cannot access the client's PlayerGui through a touch event since it is on the Client Side. You would need to use Remote Events or Functions to change anything on the Client Side.
part.Touched:Connect(function(obj) local char = obj.Parent if char:FindFirstChild("Humanoid") then remoteEvent:FireClient(game.Players:GetPlayerFromCharacter(char)) end end)