Ok so, i want to make an script that saves a players position when they disconnect from the game and when they join back, they are in the same position as they were left. Please help!
local locations = {}
while wait(1) do
for _,player in pairs(game.Players:GetChildren()) do
if player and player.Character and player.Character.Parent ~= nil then
locations[player] = player.Character.Torso.Position
end
end
end
game.Players.PlayerRemoving:connect(function(player)
local lastlocation = locations[player]
locations[player] = nil -- garbage collection
end)
I tried this but, it obviously wouldn't work. :(

1 comment
hmmm