That should not be a problem, but as I suggested make sure the PlayerRemoving codeblock is placed at the end of the script.
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
-- get data
end)
Players.PlayerRemoving:Connect(function(Player)
-- save data
end)