How to make your Character Teleport when killing a NPC?
So I'm pretty new to scripting and I wondered how I could make your character teleport to a position when you kill a NPC.
I get the error attempt to index nil with 'Character' , and I've tried researching but I simply can't find a solution on how to let the script find the HumanoidRootPart
1 | local player = game.Players.LocalPlayer |
2 | local char = player.Character |
4 | if script.Parent.Human.Health < = 0 then |
5 | char.HumanoidRootPart.CFrame = CFrame.new(Vector 3. new( 0 , 50 , 0 )) |