I'm trying to show a message when you touch a brick, and the script work when I test it in roblox studio, but in a local server not. I know I should use a "Remote Event" for make the script work, but I don't know how exactly I can do that, I'm new using Remote Events/Remote Functions.
I have this script in a brick:
debounce = false
script.Parent.Touched:connect(function(hit)
local h = hit.Parent:FindFirstChild("Humanoid")
if h and debounce == false then
debounce = true
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
Player.PlayerGui.ComprarNegocio.Terreno1.Visible = true
wait(4)
debounce = false
end
end)
When I test it in local server I get this error " ComprarNegocio is not a valid member of PlayerGui "
How can I fix it?

7 comments
The server can not access player's PlayerGui, you will need to use a remote event.
the server can access a players gui
Nope it can't. It can only see the PlayerGui folder/container, but it can't do anything with it.
I know, but how I can use the remote event for fix my script?
http://robloxdev.com/articles/Remote-Functions-and-Events
I've read it and seen tutorials before asking the question, if I'm asking, it's because I do not know how to do it in my script.
HOLA GEKO :DD