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

How would I make a brick that removes the players tools?

Asked by 5 years ago

I've searched everywhere and I cannot seem to find any explanation on how to do it.

1 answer

Log in to vote
0
Answered by 5 years ago

Its fairly simple

brick.Touched:Connect(function(part)
    local p = game.Players:GetPlayerFromCharacter(part.Parent)
    if p then
        p.Backpack:ClearAllChildren()
        if p.Character:FindFirstChildOfClass("Tool") then 
            p.Character:FindFirstChildOfClass("Tool"):Destroy()
        end
    end
end)

Just define brick as the part you want it to be. P.S .Touched can have problems in some circumstances, be careful.

Ad

Answer this question