Look at this post! The solution of this post is saying to use this script!:
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:wait()
local Tools = {}
for I, v in pairs(Player.Backpack:GetChildren()) do
Tools[v] = true
end
Char.ChildAdded:connect(function(Obj)
if Obj:IsA(“Tool”) and not Tools[Obj] then
Tools[Obj] = true
Tool.Parent = Player.Backpack
end
end)
I’ve created a response for a topic similar to this but in regards to accessories. Follow its principles (as in, just change accessory to tool) and you should be set.
As I remember, tools get equipped only when you touch the Handle part. Try to rename it and rename it back when you will need to equip it.
If you don’t understand what I mean:
Then put that script inside the Handle of your tool. What will happen is that it removes the element that let’s you pick the tool up when walking on it.
local Parent - script.Parent
Parent.ChildAdded:Connect(function(Child)
if Child:IsA("TouchInterest") then
Child:Destroy()
end
end)
This creates an event that will wait for a child to be added to the tool model (note: make this script a child of the tool or adjust the Parent value accordingly) and will remove any touch interest that is automatically added.
Can you please paste your code here, formatting it like this? Thanks.
And tool cannot be equipped if it doesn’t have a part named “Handle”. I tried this myself. There’s probably an error in your code somewhere (such as renaming the part from the client, that never works).
Old post but if someone looking for a solution you can try this.
Consider having a condition of why a tool is not Pickable. Let’s say we have a gun, the gun cannot be pick up if the player is not on Red Team.
Sample
[Tool]
local teams = game:GetService("Teams)
local tool = script.Parent
local pickUp
pickUp = tool.Disable.Touched:Connect(function(otherPart)
local char = p.Parent
local humanoid = char:FindFirstChild("Humanoid")
if humanoid then
local player = game.Players:GetPlayerFromCharacter(char)
if player.Team == teams.Red then
tool.Disable.Name = "Handle"
tool.Parent = char
pickUp:Disconnect()
end
end
end
end)