I want to make it so that the player can only have one primary weapon, but I can't find any way to make a player unable to pick up a tool when they touch it. Edit: I have an idea. If I make it so that when the player is within a certain distance of a weapon and presses a button, it puts the tool in their backpack. The only problem is that i'm not sure how to find the magnitude between the player and any weapon pickup in particular that is dropped. Can someone help?
COMMUNITY QUESTION
How do I make a player unable to pick up certain tools?
1 answer
Put this local script in starter player!
While wait() do
Local tools = script.Parent.Parent.Backpack:GetChildren()
for i = 1, #tools do
local tool = tools[i]
tool:Destroy()
end
end)
My capitalisations May be wrong cause I’m on a iPad! If you need anymore help ask.
1 comment
0
A: That destroys all tools in the backpack, B: Local and While aren't capitalized, C:you should explain your code and why it should work
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
have you tried to make a script for it yet?
you need some way to check if a tool is a primary or not like having a table of primary weapon names or using a bool value