Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is my "Full Backpack Pop-UP" not showing up when backpack is full?

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)

2 answers

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

3 comments

0

It still doesn't show up

0

Have you tried using WaitForChild on the leaderstats and Coins?

0

Yep, but I figured it out, I simply forgot StarterGui is not a valid child of player it would be PlayerGui and It worked.

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.