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

Decline being able to pickup item?

Asked by 9 years ago

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!!!

1 answer

Log in to vote
2
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

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.

0
K, trying that yogipanda123 120 — 9y
Ad

Answer this question