My title explains everything I want to do. However I have no idea how to do it. I thought of a spawnlocation but that would be very messy. So I guess the only way is datasave, how do to it correctly though? Please help!
P.S. I am not asking for a script! I just want someone to show me how I should do to accomplish my objective.
To make this, we need to save the position in a DataStore. Here is a rough example.
local PositionStore = game:GetService("DataStoreService"):GetDataStore("PositionStore") game:GetService("Players").PlayerAdded:Connect(function(player) local Character = player.Character or player.CharacterAdded:Wait() local Success, LastPosition = pcall(function() return PositionStore:GetAsync(player.UserId) end) if Success and LastPosition ~= nil then wait(1) Character:MoveTo(Vector3.new(LastPosition.X, LastPosition.Y, LastPosition.Z) end end) game:GetService("Players").PlayerRemoving:Connect(function(player) local Character = player.Character pcall(function() local CurrentPosition = { X = Character.HumanoidRootPart.Position.X, Y = Character.HumanoidRootPart.Position.Y, Z = Character.HumanoidRootPart.Position.Z } PositionStore:SetAsync(player.UserId, CurrentPosition) end) end)