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

How can I make the players location Above an objects location by a few studs?

Asked by 5 years ago

I know that I can use

game.Workspace.Part.Postion = game.Players.LocalPlayers.Character.Humanoid.Position

to bring the player to a part burt how can i change the teleport spot relative to the object like say, 3 studs up?

0
game.Workspace.Part.Postion = game.Players.LocalPlayer.Character.Head.Position + Vector3.new(0, 3, 0); User#24403 69 — 5y
0
it isnt working, I think it is because it is actually a union? 50ShadesofLamps 5 — 5y
0
You're assigning the part's position to the character's position, not the other way around. Your code is not doing what you're explaining. pidgey 548 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

One easy way, without any coding,

the spawnlocation is always an invisible part, although most spawn model you get from market place is a model. why not move the real spawnlocation inside the model to 3 studs above?

Ad
Log in to vote
0
Answered by
Fifkee 2017 Community Moderator Moderation Voter
5 years ago

You can add multiple Vector3 values (and multiple Vector3 values to CFrame values). Utilizing this feature of Vector3, we can set the player's Root CFrame to the part, and offset the Y axis by 3 studs.

Player.Character.HumanoidRootPart.CFrame = workspace.Part.CFrame + Vector3.new(0,3,0)

Answer this question