How to make sure that when the player buys a car, it will be backed up, so when they come back, they will not have to buy it back ?

game.ReplicatedStorage:WaitForChild("CheckPrice").OnServerInvoke = function(player,NameOfCar)

return game.ServerStorage.Cars:FindFirstChild(NameOfCar).Price.Value end

game.ReplicatedStorage:WaitForChild("SpawnCar").OnServerEvent:Connect(function(player,NameOfCar) local car = game.ServerStorage.Cars:FindFirstChild(NameOfCar):Clone() car:SetPrimaryPartCFrame(player.Character.HumanoidRootPart.CFrame + Vector3.new(0,5,30)) car.Parent = workspace car:MakeJoints() car.Name = player.Name.."Car"

4 comments

0

You use GetAsync when playeris Added so you go game.Players.PlayerAdded:Connect(function() then for data saving do SetAsync when playeris removed

0

Nice, a copied script from alvinbloxx.

0

alvinbloxx is a legend

0

i learned some of how to script from him