Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I remove a tool without them having to reset?

I'm trying to make a broom that destroys after a certain amount of hits and I'm working on the destroy script. I figured it out but the tool removes but the player needs to reset before it's removed, really don't want to have to kill the player each time.. Here's what I have:

local broomHealth = script.Parent.broomhealth.broomhealth.Value
local plrBackpack = game.Players.LocalPlayer.Backpack
while true do
	wait(10)
	plrBackpack:FindFirstChild("Broom")
	if broomHealth <= 0 then
		plrBackpack.Broom:Destroy()
	end
end

Thanks :)

1 answer

The thing is, if the person has that equipped, then the broom model is actually in their character model and not in their backpack. Try destroying the broom from the character model instead of the backpack.

If this is a local script you can do

local player = game.Players.LocalPlayer
local character = player.Character

character.Broom:Destroy()

This discussion is preserved as it was. New answers, comments, and votes are closed.