So I've got a script that has a part that is supposed to clear the player's inventory. I know I can use ClearAllChildren to the player's backpack, but if a player is holding a tool, then it doesn't get rid of that.

Here is what I have so far:

script.Parent.SendTo.OnServerEvent:Connect(function(plr)
	Detainee.Team = game.Teams.Solitary
	if Detainee.Character:FindFirstChildOfClass("Tool") then
		Detainee.Character:FindFirstChildOfClass("Tool"):Destroy()
	end
	Detainee.Backpack:ClearAllChildren()
end)

3 comments

0

Check if there is a tool inside of the player's Character and if so, delete it.

0

Off topic.

0

No script = no help = off topic