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.
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.
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!
Thanks! Really helped me move a certain model to the player i needed. :)
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
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.
alright thanks, forgot to add, im trying to make it go to a Certain player, like a person in the lobby or something