So, I have a script that is supposed to teleport a player to a certain position once they die. However, I am getting a "Position cannot be assigned to" error. Here is the code:
local player = game.Players:GetPlayerFromCharacter(hit.Parent) if hit.Parent:FindFirstChild("Humanoid") then while wait(0.1) do while wait(0.1) do -- I have 2 loops to make it go a lot longer if player.Character.Humanoid.Health == 0 then wait(6) player.Character.HumanoidRootPart.CFrame.Position = Vector3.new(1, 2, 3) end end end end
Thanks in advance for any help!
Just do:
player.Character.HumanoidRootPart.Position = Vector3.new(1, 2, 3)
instead of:
player.Character.HumanoidRootPart.CFrame.Position = Vector3.new(1, 2, 3)