Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-2

how to make a remove all tools upon touching a part script?

Asked by 2 years ago

I wanted To Make a Trap Card Sorta Thing On My Red vs Blue Game Im Working On, I Already Got The Buying Trap And Placing It Down Working, But I Can't Figure Out How To Make The Remove All Tools From The Player's Backpack, So How Do I Do It? (also, it also needs to remove the player's hand tool)

0
You asked this same question before and, I answered it. If you forgot here's the link! If I answered your question please accept it as the solution. https://scriptinghelpers.org/questions/124067/how-to-remove-all-tools-from-a-persons-backpack-when-they-touch-a-part#113096 ElBamino 153 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

It`s simple, use a touched event. Example :

local part = game.Workspace.Part
part.Touched:connect(function(hit)
-- proceed to delete the tools that you have inside your backpack, i can`t give u a more detailed script because you didn`t provide any script of yours so i dont know what the names of the tools you have in your backpack and etc, hope it helps.
end)

Or another example :

for _,v in pairs(player.Character:GetChildren()) do
    if v:IsA("Tool") then
        v:Destroy()
    end
end

If those helped, i would appreciate an marked answer for that sweet sweet reputation :D Have a good day !

Ad

Answer this question