I've enabled API access to roblox studio btw, I am very confused how this is not working on studio but works on the actual game, might be cause I am changing the values through the explorer and properties tab and not through like some sort of script when I am in studio and when I am in the actual game I pull out the dev console and type command to give myself money that way..
local DS = game:GetService("DataStoreService")
local myDS = DS:GetDataStore("FlexingSimulatorDataStor")
local startingFlexCoins = 15
game.Players.PlayerAdded:Connect(function(plr)
local leader = Instance.new("Folder",plr)
leader.Name = "leaderstats"
local stats = Instance.new("Configuration",plr)
stats.Name = "Stats"
local flexCoins = Instance.new("IntValue",leader)
flexCoins.Name = "FlexCoins"
local ego = Instance.new("IntValue",stats)
ego.Name = "Ego"
local key = "key - "..plr.UserId
local playerData = myDS:GetAsync(key)
if playerData then
flexCoins.Value = playerData[1] or startingFlexCoins
ego.Value = playerData[2]
else
local valuesToSave = {flexCoins.Value,ego.Value}
myDS:SetAsync(key,valuesToSave)
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
local key = "key - "..plr.UserId
local data = {
plr.leaderstats.FlexCoins.Value,
plr.Stats.Ego.Value,
}
myDS:SetAsync(key,data)
end)

2 comments
Yea, that's fine, because when you change the values on the explorer tab, you're changing them from the client, unless you switch your view to the server view while playing.
I heard server stuff used to never work in the studio, so if you are running it as the client, it won't look like it's working.