script.Parent.Touched:Connect(function()
game.StarterGui.ScreenGui.Frame.BackgroundTransparency = 1
wait(5)
game.StarterGui.ScreenGui.Frame.BackgroundTransparency = 0
end)
✓ ANSWER ACCEPTED
Whats wrong with this function? It doesn't change anything.
1 answer
✓ Accepted answer
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
Thank you!
By the way it'd be nice if you accepted his answer.
sry i was new to this site