Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 8 years ago
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

Log in to vote
1
Answered by 8 years ago
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)
0
Thanks for the help your answer actually helped robloxiveboy 25 — 8y
Ad
Log in to vote
0
Answered by 8 years ago
    elseif  v.Visible == false then
        print("full")

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

Answer this question