I'm trying to get a GUI placed in the toucher of a seat when they sit down, however it's turned out rather crooked.
GUI = script.Parent.GOLIATH
script.Parent.Touched:connect(function (hit)
wait(0.5)
if not script.Parent:FindFirstChild("SeatWeld") then return end
if not game.Players:FindFirstChild(hit.Parent.Name).PlayerGui.GOLIATH then
local NewGUI = GUI:Clone()
NewGUI.Parent = game.Players:FindFirstChild(hit.Parent.Name).PlayerGui
end
end)
That's the code, and it's throwing the error:
GOLIATH is not a valid member of PlayerGui Script 'Workspace.Goliath Prototype, dawg.Part.Script', Line 6 Stack End
The objective of the script is to check if the player has the GUI, and if not, place the GUI on their screen. When they stop touching the seat, the GUI disappears.
