I made a prox prompt that gives the player a tool, but how do I make it to where if they have it the prompt disappears for that player only. Same for everyone else. This is the code I'm using to give the player the tool. I tried checking the backpack for the child which is the tool name and then destroying the prompt, but I think that would destroy it for everyone. Any help?
local tool = game.ServerStorage.Wrench
local prompt = script.Parent.ProximityPrompt
local function pickup(player)
tool:Clone().Parent = game.Workspace[player.Name]
end
local player = game:GetService("Players")
prompt.Triggered:Connect(pickup)
local Tool = player.BackPack:FindFirstChild("Wrench")
if player.BackPack.Child == Tool then
prompt:Destroy()
end

1 comment
When using the If conditional, whenever I run the game I get an error message about the Backpack: Workspace.Handle.Script:7: attempt to index nil with 'Backpack'