Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How build a Car shop datastore ?

Asked by 5 years ago
Edited 5 years ago

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"

0
You use GetAsync when playeris Added so you go game.Players.PlayerAdded:Connect(function() then for data saving do SetAsync when playeris removed User#22788 5 — 5y
0
Nice, a copied script from alvinbloxx. User#19524 175 — 5y
0
alvinbloxx is a legend greatneil80 2647 — 5y
0
i learned some of how to script from him HappyTimIsHim 652 — 5y

Answer this question