I have a datastore that works perfectly fine in one game, but when i put it into another, it does not work. i have literally copy and pasted the same thing into each game, and both games have API services turned on. the code is below.
local DataStoreService = game:GetService("DataStoreService") local DataStore = DataStoreService:GetDataStore("StarterCarUpgrades")
game.Players.PlayerAdded:Connect(function(Player) local clone = game.ReplicatedStorage.PlayerData:Clone() clone.StartercarUpgradeValue.Value = DataStore:GetAsync(Player.UserId) or 0 clone.Name = "PlayerData" clone.Parent = Player end)
game.Players.PlayerRemoving:Connect(function(Player) DataStore:SetAsync(Player.UserId, Player:WaitForChild("PlayerData").StartercarUpgradeValue.Value) end)

2 comments
lol bro really tried to give himself currency that's not how it works lol
what did i do wrong? also how does this involve currency?