Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Whats wrong with this function? It doesn't change anything.

script.Parent.Touched:Connect(function()
	game.StarterGui.ScreenGui.Frame.BackgroundTransparency = 1
	wait(5)
	game.StarterGui.ScreenGui.Frame.BackgroundTransparency = 0
end)

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)

3 comments

1

Thank you!

0

By the way it'd be nice if you accepted his answer.

0

sry i was new to this site

This discussion is preserved as it was. New answers, comments, and votes are closed.