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

How could I check to see if an item is in the items folder?

Asked by 7 years ago

Ok, so i'm making an inventory system(need help), and I'm trying to do it by myself even though I've never doen it before. How would I check to see if there is more than one of the item that is collect or if there is none that way I could control the amount and the item in the inventory

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago
01--Place this in a localscript
02--The localscript has to be in StarterPlayers.PlayerScripts(NOT CHARACTER SCRIPTS)
03--In the tool use a "IntValue" in the tool and set it to 1 in properties
04--Rename the IntValue to "ToolCount"
05while wait() do
06    local tools = game.Players.LocalPlayer.BackPack:GetChildren()
07    for _,count in ipairs(tools) do
08        local numbers = count.ToolCount.Value
09        print(1 < numbers)
10        print(numbers)
11--[[This is the code i came up with because i cant really understand what you going to use it for, so i just made a script that gets the children and takes the value inside them, and prints true if its more than 1 in the players backpack, and it also prints how many it is
12--Tell me if it does not work and i will check it
13]]
14    end
15end
0
it's for a survival game IAmKingMatt -8 — 7y
0
Fixed it! Contact me if you remember me on Discord! Got it and i have the script! VenomiZeD_VamqireXz 111 — 7y
Ad

Answer this question