script.Parent.Touched:Connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent)then hit.Player.Humanoid.UpperTorso.Destroy() end end)
-- Server Script local Main = script.Parent -- Our part that we'll check if it's touched by a player local Players = game:GetService("Players") Main.Touched:Connect(function(Hit) -- When part is touched local Player = Players:GetPlayerFromCharacter(Hit.Parent) -- Our player if Player.Character then -- If the character exists Player.Character:BreakJoints() -- Breaking every joint in the player causing the player to reset end end)
Since your question isn't constructive at all without any information about the script you provided and the code you've sent seems to be a death on-touch for a part.
So there's the fixed code, for future references please make your questions constructive enough for other people to understand your problem.
Sorry, a player torso was not able to delete. The people will die immediately if the torso was removed.
You better use other ways to do your game or try another way to figure out.