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

It Says "Inventory2 is not a valid member of ScreenGui" HELP ME?!?!?!?!?!

Asked by 9 years ago

It has an error when i play the game With 2 Players and i'm not sure why Here's The Code

game.Players.LocalPlayer.PlayerGui.InventoryGui.Inventory2.MouseButton1Click:connect(function()

----------Open


    print("rgdr")
    game.Players.LocalPlayer.PlayerGui.InventoryGui.Frame.Visible = true



---------Spawn Plane




game.Players.LocalPlayer.PlayerGui.InventoryGui.Frame.SpawnPlane.MouseButton1Click:connect(function()


    ----What Will Happen When you Spawn The Plane





end)





-----CLOSE


if game.Players.LocalPlayer.PlayerGui.InventoryGui.Frame.Visible == true then

    game.Players.LocalPlayer.PlayerGui.InventoryGui.Frame.Close.MouseButton1Click:connect(function()

        game.Players.LocalPlayer.PlayerGui.InventoryGui.Frame.Visible = false

    end)
end

end

0
it appears you need a delay. I believe it is trying to find the "Inventory2" gui before it has been loaded. TopDev 0 — 9y
0
Yup. Try using :WaitForChild() dyler3 1510 — 9y
0
OMG OMG YOU ARE SO SMART IT WORKS I HAVE BEN TRYING TO FIX ALL DAY TY TY TY SO MUCH space1177 7 — 9y

Answer this question