I am making a script, when you pick up an item, a script inside the item will add 1 to a value in the players backpack, but if the value is more than 2 (2 inventory items) it will not let you pick it up. My question is how could I or is it possible to not let the player pick up items? THIS IS NOT A REQUEST, JUST A QUESTION, NOR AM I ASKING YOU FOR A SCRIPT! here is what I have so far (as you can see i have no idea how you could decline picking up items!)
while true do wait(5) local item = script.Parent.Parent:GetChildren() if item.ClassName == "Tool" then script.Parent.Value = script.Parent.Value + 1 end print(item) end
Please help!!! Again, this is not a request, just a question! Thank you!!!
Don't use Tool objects, because being picked up is how they do.
Instead, just use a model that looks like the tool, and when it is touched, run through the logic and clone a prototype of the tool into the player's backpack.