Log in to vote

How to make your Character Teleport when killing a NPC?

Asked by 2 years ago

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

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

if script.Parent.Human.Health <= 0 then
    char.HumanoidRootPart.CFrame =, 50, 0))

Answer this question