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

Output won't stop printing full in my for loop? Solved

Mouse.KeyDown:connect(function(key)
    key = key:lower() 
    	if key == "f" then 
			if Mouse.Target:FindFirstChild("Class") then

for i, v in pairs (BackPack) do
	if v.empty.Value == 0 and v.Visible == true then
		v.Nam.Value = Mouse.Target.NM.Value 
		v.Dec.Value = Mouse.Target.Dec.Value 
		v.empty.Value = 1
		Mouse.Target:Destroy()
		break
	else if v.empty.Value == 1 or v.Visible == false then 
		print("full")
	
					end
				end
			end
		end
	end
end)

After my first equip on an item, I equip the second time and since its a run down list it prints full for everyone else and then equips. I don't know how to overcome this.

I'm makign a new inventory system for myself so if i say equip i mean in backpack that i made.

I'm trying to make output say full when the last choice of item slots is taken. So that theres compatibility for all amounts of item slots

2 answers

Mouse.KeyDown:connect(function(key)
    key = key:lower() 
        if key == "f" then 
            if Mouse.Target:FindFirstChild("Class") then

for i, v in pairs (BackPack) do
    if v.empty.Value == 0 and v.Visible == true then
        v.Nam.Value = Mouse.Target.NM.Value 
        v.Dec.Value = Mouse.Target.Dec.Value 
        v.empty.Value = 1
        Mouse.Target:Destroy()
        break
    else if v.empty.Value == 1 or v.Visible == false then --Change visible false to true.
        print("full")

                    end
                end
            end
        end
    end
end)

1 comment

0

Thanks for the help your answer actually helped

    elseif  v.Visible == false then
        print("full")

instead I just included an extra non visible full indicator box and just did this

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