I have a string value that takes my last known position and changes it with tostring(). When I join back, that value is exactly the same, showing that it saves correctly.

When I leave

p.CharacterRemoving:Connect(function(char)
	local lastPos = tostring(char.HumanoidRootPart.Position)
	StringModel.CharacterPosition.Value = lastPos
	print(StringModel.CharacterPosition.Value)
end)

When I join

p.CharacterAdded:Connect(function(char)
	if Spawned[p.Name].Spawned == false then --If first spawn
		local newPos = Vector3.new(tonumber(StringModel.CharacterPosition.Value))
		print(newPos) --last position is correct
		p.Character.HumanoidRootPart.CFrame = CFrame.new(newPos)
		--^ not working. i still spawn in the same old spot
		print("Teleported")
		Spawned[p.Name].Spawned = true
	end		
end)

I do not have a spawnlocation to conflict, not sure whats going on.

6 comments

0

Try p.Character.HumanoidRootPart:MoveTo(newPos)

0

convert it back to s CFrame Value

0

Neither worked.

0

Can you clarify as to what / where the "stringmodel" is? if its in the player's character then when the character is removed so is the value...

0

Its my data model for strings. It is not the problem, if you read what I said it saves when I leave and loads in the CORRECT position when i spawn back in. its just not moving towards it.

0

when i join back: http://prntscr.com/ph18ao As you can see it grabbed my last position just fine. It just isn't teleporting to it.