I am having trouble creating a script that goes in a part, kills a player, and then replicates a child of the plrModel and puts it in the new torso of the living character. No portion of the code executes properly.
local plr = game.Players.LocalPlayer local plrModel = game.ReplicatedStorage:WaitForChild(plr.Name) local particle = plrModel:FindFirstChild() function onTouched(hit) print("death test") local human = hit.Parent:FindFirstChild("Humanoid") if human ~= nil then human.Health = 0 end end function touchedMe(hit) print("test") if particle ~= nil then print("test1") local newClone = particle:Clone() local newCharacter = game.Workspace:WaitForChild("plr.Character"):WaitForChild("UpperTorso") newClone.Parent = newCharacter print("test2") end end script.Parent.Touched:connect(onTouched) script.Parent.Touched:connect(touchedMe)
Nothing in this script is executing. Its purpose, is to clone any particle from the PlayerModel located in ReplicatedStorage after the player dies. Do you know how I could fix it? The player is not dying.