I'm trying to make a Trashcan that has a Proximity Prompt, that let's you destroy the tool that you have currently equipped. I need help finishing this script.
local KeyPart = script.Parent local Prompt = KeyPart.ProximityPrompt
Prompt.Triggered:Connect(function(player) local bp = player.Backpack if bp:FindFirstChild("Keycard") then --- then what??
end
end)
edit: nvm i see you are doin something different
local KeyPart = script.Parent local Prompt = KeyPart.ProximityPrompt Prompt.Triggered:Connect(function(player) local chr = game.Workspace:FindFirstChild(player.Name) if chr:FindFirstChildWhichIsA("Tool") then chr:FindFirstChildWhichIsA("Tool"):Destroy() else return end end)
Well, you have to be More especific, but, From what i understand, I've created a Script to make it.
local Proximity = script.Parent --Here the Localization of the Proximity Prompt. local Stuff = " " --Here the Tool name from a String. local BackPack = game.Players.LocalPlayer.Backpack Proximity.Triggered:Connect(function() if BackPack:FindFirstChild(Stuff) then BackPack:FindFirstChild(Stuff):Destroy() else print("There is nothing :/") end end)