Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I get a teleport NPC like the player?

local mynpc = game.Workspace.npc:GetChildren()

for i,v in pairs do v.Position = Vector3.new() -- i use this script but it does not work

--teleports but has all parts in one position

end

1 comment

0

Is it an R15 or an R6 NPC?

1 answer

You don't have to move every bodypart to a position. Moving 1 bodypart like the HumanoidRootPart is fine. So this would be your script:

local mynpc = game.Workspace.npc

function Teleport(position)
	mynpc.HumanoidRootPart.CFrame = CFrame.new(position)

end

Teleport(Vector3.new(-- Your position here))

2 comments

0

If you teleport the HumanoidRootPart via Vector3, then it will kill the character. I suggest just putting in the coordinates in CFrame.new() instead of just using a function. It makes things too complicated.

0

It does not kill the character since the body parts are connected with constraints.

This discussion is preserved as it was. New answers, comments, and votes are closed.