I have this GUI that allows players to open/close a gate. You must stand on this block for the GUI to show up, I've been getting this error whenever I stand on it.
GateGUI is not a valid member of PlayerGui Stack Begin Script 'Workspace.Part.Script', Line 3 Stack end
I have a remote event called 'Gate' In replicated Storage.
In the block you must stand on I have a local script, here is the code:
script.Parent.Touched:connect(function(hit)
game.ReplicatedStorage.Gate:FireServer(hit)
end)
After that I have a script in ServerScript service, here is the code:
game.Workspace.Gate.OnServerEvent:Connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') then
game.Players[hit.Parent.Name].PlayerGui.GateGUI.Box.Visible = true
end
end)
Any help would be appreciated.

2 comments
This is pretty self explanatory "GateGUI" is not in PlayerGui. Start up a test server and go to PlayerGui and see what happened to it.
The gui is in player gui but I still get the error.