Hi There! I need some help. I want to create a Proximity Prompt that when Activated Deletes an entire inventory for a cafe game! If you could help me please lmk.
Also if I put this in the wrong category please let me know. I’m still new to the dev forum.
Also for the thing, you could make it so whoever interacts with the Prompt, it unequips their tools and removes all the stuff in the backpack.
The Triggered event for ProximityPrompts works wonders for it, as it returns the player who triggered the prompt, you can use that returned player to get the Character’s Humanoid, and use UnequipTools(), and then go through the player’s backpack and destroy all the tools in there
That will not work at all, there’s a lot of typos and incorrect syntaxing, also tool is not specified, you can’t just go off copy and pasting, we’re giving you ways to actually do what is needed
When the prompt is triggered,
Use the player it gives you and get the character via .Character, and then get the Humanoid from that character
Use :UnequipTools() on the Humanoid
Loop through the player’s backpack and destroy everything there via :Destroy()
local player = game:GetService("Players").LocalPlayer
proximityPrompt.Triggered:Connect(function()
for _, item in pairs(player.Backpack:GetChildren()) do
item:Destroy()
end
end)
@OP wanted a Proxmityprompts that can destroy all the tools you own, that will not work for what they want
Also, @Mysterious_Myth11 it’s better to put it as a reglar script in the prompt itself and use the return Triggered gives instead, also it wont account if the player is holding a tool, so you have to make it unequip any tools the player is holding and then destroy
local prompt = script.Parent
prompt.Triggered:Connect(function(player)
local backpack = player.Backpack
local char = player.Character
if not char then return end
local hum = char.Humanoid
hum:UnequipTools()
wait()
for _,tool in pairs(backpack:GetChildren()) do
tool:Destroy()
end
end)