I am doing an inventory system and I want a gui to be triggered when an object is detected in the inventory. but it appears to me that backpack is not a valid member. this is the code
local Classic = game.ReplicatedStorage.Library.ClassicSword
local Fire = game.ReplicatedStorage.Library.FireSword
local super = game.ReplicatedStorage.Library.SuperSword
local gold = game.ReplicatedStorage.Library.GoldSword
local rain = game.ReplicatedStorage.Library.RainBow
local soword = game.ReplicatedStorage.Library.SwordofStarlight
local devil = game.ReplicatedStorage.Library[“Devil Sword”]
local CGUI = script.Parent.Classic
local FGUI = script.Parent.Fire
local SGUI = script.Parent.Super
local GGUI = script.Parent.Golden
local RGUI = script.Parent.Raimbow
local SSGUI = script.Parent.Starlinhgt
local DGUI = script.Parent.devil
local player = script.Parent.Parent.Parent.Parent
local CS = player.Backpack.ClassicSword
local FS = player.Backpack.FireSword
local SS = player.Backpack.SuperSword
local GS = player.Backpack.GoldSword
local RS = player.Backpack.RainBow
local STS = player.Backpack.SwordofStarlight
DS = player.Backpack[“Devil Sword”]
if CS then
CGUI.Visible = true
elseif FS then
FGUI.Visible = true
elseif SS then
SGUI.Visible = true
elseif GS then
GGUI.Visible = true
elseif RS then
RGUI.Visible = true
elseif STS then
SSGUI.Visible = true
elseif DS then
DGUI.Visible = true
end