The code checks for if the tool is already in someones inventory, but for some reason it doesnt apply if that said tool is equipped, how do i prevent that from happening??
Toolname = "EBR14"
function boop(Player)
if not Player.Backpack:FindFirstChild(Toolname) then
local Tool = game.ReplicatedStorage.usedTools[Toolname]:clone()
Tool.Parent = Player.Backpack
end
end
script.Parent.ProximityPrompt.Triggered:connect(boop)
when a player equips a tool the tool is parented to their character, so it wont be in the backpack. when you check if its in their backpack also check if its in their character
Toolname = "EBR14"
function boop(Player)
if not Player.Backpack:FindFirstChild(Toolname) and not Player.Character:FindFirstChild(Toolname) then
local Tool = game.ReplicatedStorage.usedTools[Toolname]:clone()
Tool.Parent = Player.Backpack
end
end
script.Parent.ProximityPrompt.Triggered:connect(boop)