Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

BillboardGui1 is not a valid member of PlayerGui "Players.jeremqpmfpi.PlayerGui"?

Asked by 3 years ago

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)

1 answer

Log in to vote
0
Answered by 3 years ago

i kinda figured it out the script was a server script not a local script you need a local script to change gui properties so i will be doing that

Ad

Answer this question