I'm working on an Inventory system, I have run into a problem that basically doesn't make a GUI appear if the player has a BoolValue
thats value is true
.
Here is the code:
--<< Variables >>-- local plr = game.Players.LocalPlayer local bool = plr.ShopItems.Knives --<< Frames >>-- local bg = script.Parent local knifeinv = bg.Knives local revinv = bg.Revolver local abilinv = bg.Abilities local petinv = bg.Pets local radioinv = bg.Radios local newknife = knifeinv.Template:Clone() if bool.Common.Value == true then newknife.Visible = true newknife.Name = "KnifeA" newknife.Rarity.ImageColor3:FromRGB(43,125,43) newknife.Text = "Starter" else return false end if bool.UnCommon.Value == true then newknife.Visible = true newknife.Name = "KnifeB" newknife.Rarity.ImageColor3:FromRGB(43,125,43) newknife.Text = "Skies" else return false end
If you can help, please do and thank you for taking the time to read this
Since the code isn't inside an event or a loop, the if statements only run when the script is created. You can use the following event to see when it's value changed:
boolValue = bool.Common boolValue.Changed:Connect(function() print(boolValue.Value) end)