i am trying to make it so that when the player joins and they are on the construction team it should put the gui over a certain light part but that error pops up 11:12:55.352 BillboardGui1 is not a valid member of PlayerGui "Players.jeremqpmfpi.PlayerGui" - Server - ClickDetectorScript:6
here is my code
local clickdetecter = script.Parent:WaitForChild("ClickDetector")
local Team = game:GetService("Teams"):WaitForChild("Construction")
local function OnPlayerJoin(player)
if player.Team == Team then
player.PlayerGui.BillboardGui1.Enabled = true
print("gui is now enabled")
end
end
game.Players.PlayerAdded:Connect(OnPlayerJoin)
local function onMouseClick(player)
print('player who clicked is ' .. player.Name)
if script.Parent.broken.Value == true then
if player.Team == Team then
print("player is on construction")
script.Parent.broken.Value = false
else
print("player is not on construction")
end
else
print("light is not broken")
end
end
clickdetecter.MouseClick:Connect(onMouseClick)
