How do I make a gui pop up when in contact with a brick?

I want to make a UI.TextLabel talk to you when you come in contact with a brick, possible for anybody to help fix my problem?

I have tried doing:
game.workspace.StarterGui.ScreenGui.TextLabel.Text = blah blah blah
and
game.StarterGui.ScreenGui.TextLabel.Text = blah blah blah
^
This has been the closest Ive gotten to attempting at fixing my problem, but never have it seem to work.

Im unsure if there is a bigger process to go by but if you have the solution, please tell me how to resolve this problem, thank you :smiley:

If you want pictures I have some right here for you :slight_smile:
image
(Line 13 is where im having the problem)

2 Likes

Can you send screenshot of error we can’t help you.

1 Like

it would be this:

local plr = game.Players.LocalPlayer

script.Parent.Touched:Connect(function(hit)
game.plr.PlayerGui.GUI.Visible = true
end

change GUI to your gui’s name

4 Likes

Sorry this is my first post, Im new to this :slight_smile:

Thanks Ill try it now :stuck_out_tongue:

Oh sure no problem just send me screenshot of error

I think ekuz0diaa might of fixed the problem im not sure, ill try it

Oh also is there a specific place I need to put this?

I think a local script in the brick that you want on touch to be fired

If no you should use this

script.Parent.Touched:Connect(funtion(hit)
Local Player = game.Players:FindFirstChild(hit.Parent.Name)
if Player then -- Here we checking if hit is a player
Player.PlayerGui.GUI.Enabled = true
end
end)

Change GUI to your name of GUI
I hope it’s help you

You can’t put local scripts in workspace. I’m gonna write you the code and explain it in a sec.
Nevermind imma work on my own stuff but you can do it like this:
Detect when the part gets hit, then fire a client event from a script inside that part. And then in a local script in the text label, detect when the client gets fired and do, script.parent.parent.visible = true I’m too lazy to do it lol

1 Like

Adding on to what @SchwarzWalde said, you can hook it up by using Remotes. So the server will fire a RemoteEvent, and send it to the client.

1 Like

Alvin blox made an video recently about that, just check it.

I once had this problem and I watched this video click here