local DSS = game:GetService("DataStoreService") local cars_store = DSS:GetDataStore("player_cars") local SS = game:GetService("ServerStorage") local dealer = game.Workspace.dealer function spawn_car(player) local player_id = player.UserId -- idk what to add next print(player_id) cars_store:SetAsync(player_id, cars_store) end dealer.head.ProximityPrompt.Triggered:Connect(spawn_car)
I haven't tested this out. But by looking at it it seems that in line 10, you're missing a value. The script is expecting an argument, but it got an instance which is cars_store
in this case.
Simply replace this:
cars_store:SetAsync(player_id, cars_store)
With this:
cars_store:SetAsync(player_id, 50) --change 50 to ur value name
(EDIT:)
Also, don't forget to reference the player!
Full script:
local player = game.Players.PlayerAdded:Connect(function(player) local DSS = game:GetService("DataStoreService") local cars_store = DSS:GetDataStore("player_cars") local SS = game:GetService("ServerStorage") local dealer = game.Workspace.dealer function spawn_car(player) local player_id = player.UserId -- idk what to add next print(player_id) cars_store:SetAsync(player_id, 50) end end) dealer.head.ProximityPrompt.Triggered:Connect(spawn_car)
If you need any more assistance, ask and I'll try to help you.