Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Teleporting A Part/Model to a certain player?

Asked by 7 years ago

Fairly new to scripting, been wondering how to make a model and/or Part teleport above the players torso.

I have tried CFraming the object to the camera, but above it. Im just wondering how to get it to go to a certain player.

1
An easy way to do this would be to set the part's position property to the target player's torso position, if you wanted to teleport the part above the player, you could take the X Y and Z of the player's torso position and create a new Vector3 position with some number added to the Y coordinate and set that as the new position for the part. jamesfelicia 2 — 7y
0
alright thanks, forgot to add, im trying to make it go to a Certain player, like a person in the lobby or something The_MRAP 4 — 7y

1 answer

Log in to vote
3
Answered by
TrippyV 314 Donator Moderation Voter
7 years ago
Edited 7 years ago

Here's what you probably need:


If you're using a model, use this code:

local model = PutModelLocationHere
local player = game.Players["PlayerNameHere"]

model:MoveTo(player.Character.Torso.Position)

If you're using a part, use this:

local part = PutPartLocationHere
local player = game.Players["PlayerNameHere"]

part.Position = player.Character.Torso.Position

Should all work in theory, if you have any troubles be sure to comment!

0
Thanks! Really helped me move a certain model to the player i needed. :) The_MRAP 4 — 7y
Ad

Answer this question