Like any other simulator, I have a backpack and I was making a pop-up GUI that shows when your backpack is full.. and I made this script and it showed no errors, so can someone help please? Also, each backpack value is ran off of one value..
here is the pop-up script..
game.Players.PlayerAdded:Connect(function(plr) local cr = plr.leaderstats.Coins -- leaderstat cr.Changed:Connect(function() if cr.Value == plr:FindFirstChild("BackpackEquipped").bp.Value then -- bp is the name of the value game.StarterGui.ScreenGui1.sc1.Visible = true end end) end)
Right here you need to make the value equal another value. It is currently returning it as ~=
if cr.Value == plr:FindFirstChild("BackpackEquipped").bp then
should be
if cr.Value == plr:FindFirstChild("BackpackEquipped").bp.Value then
I forgot StarterGui is not a child of player... it would be PlayerGui since I am getting the child from the player..
so instead of starterGui use,
game.Players.PlayerAdded:Connect(function(plr) wait(1) local cr = plr.leaderstats.Coins cr.Changed:Connect(function() if cr.Value == plr:WaitForChild("BackpackEquipped").bp.Value then if plr.PlayerGui.ScreenGui1.sc1.Visible == false then plr.PlayerGui.ScreenGui1.sc1.Visible = true end end end) end)