I have this datastore script but its not saving my data and I was wondering if its because im in studio?
local datastoreservice = game:GetService("DataStoreService") local datastore = datastoreservice:GetDataStore("mydatastore") game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player local Green = Instance.new("IntValue") Green.Name = "Green" Green.Parent = leaderstats Green.Value = datastore:GetAsync(player.UserId.."Green") end) game.Players.PlayerRemoving:Connect(function(player) datastore:SetAsync(player.UserId.."Green", player.leaderstats.Green.Value) end)
Go to Studio>Settings>Security>Enable Studio Access to API services>On What that does is it lets you test datastores in studio. Also, I recommend making an answer if someone or yourself answers you question, and so if you accept it, both of you will get some reputation.