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

How to make a Part's Position be the same as a Player's Position?

Asked by 5 years ago
Edited 5 years ago

local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local Camera = workspace.CurrentCamera

repeat wait() Camera.CameraType = Enum.CameraType.Scriptable until Camera.CameraType == Enum.CameraType.Scriptable Camera.CFrame = workspace.CameraPart.CFrame workspace.CharacterCamera.CameraPart.Position = Player."Player.Name".Humanoid.Position

So I don't know how to define the "Player" once he's joined the game is all. There's an output msg - Players.Dudez2Good4u.PlayerGui.Camera:10: '<name>' expected near '"Player.Name"'

0
Does it show any errors or warnings? Y_VRN 246 — 5y
0
This was answered but the guy has to post his answer Dudez2Good4u 20 — 5y
0
I don't know what you mean but I'll answer anyways. It should be workspace.CharacterCamera.CameraPart.Position = Character.HumanoidRootPart.Position. Y_VRN 246 — 5y
0
About the error, line 10 requires brackets. Instead of Player."Player.Name", use Player[Player.Name]. Y_VRN 246 — 5y
0
Ur stupid aaaaaaaaaa, instances have a metatable with an __index field so works ur making me depressed with ur stupidity User#24403 69 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Just do a while true do loop and make it wait (0.1) then part.position = player's humanoid.position

Ad

Answer this question