You'll want to use remote events for this matter. Use a server script and a local script. The server script would be if you touch the brick then you would fire the server and on the local script you would do retrieve the remote events from the server script and make it do what you want. Example:
--//Server script
local brick = script.Parent --brick is in workspace
local remoteEvent = game.ReplicatedStorage.RemoteEvent --where the remote event is located
brick.Touched:Connect(function(hit) --when the player touches the brick
local plr = hit.Parent:GetPlayerFromCharacter() -getting the player from character
local hum = hit.Parent:FindFirstChild("Humanoid") --finds the humanoid
if hum ~= nil then --checks to see if the object touched has a humanoid
remoteEvent:FireServer(plr) --fires remote event
end)
--//Local script
local remoteEvent = game.ReplicatedStorage.RemoteEvent --where the remote event is located
local screenGui = script --wherever the gui is located
remoteEvent.OnServcerEvent:Connect(function(plr) --retrieve data from fired server
screenGui.Parent = plr.PlayerGui --parents the screenGui to PlayerGui
**I did not try it on studio yet, but go ahead see if it works and if it doesn't just hmu and I can further help you :)
2 comments
gui is not defined
it is. gui = script.Parent