My data store only works in studio and not in the game
local player = game.Players
local DataStore = game:GetService("DataStoreService")
local ds1 = DataStore:GetDataStore('New')
game.Players.PlayerAdded:connect(function(player)
local ldr = game.Players.LocalPlayer:WaitForChild('ldr')
local lvl = ldr:WaitForChild('Level')
local stam = ldr:WaitForChild('StaminaLvl')
local aura = ldr:WaitForChild('AuraLimitLvl')
lvl.Value = ds1:GetAsync(player.UserId) or 1
stam.Value = ds1:GetAsync(player.UserId) or 1
aura.Value = ds1:GetAsync(player.UserId) or 1
lvl:GetPropertyChangedSignal('Value'):connect(function()
ds1:SetAsync(player.UserId,lvl.Value)
print("save "..lvl.Value)
end)
stam:GetPropertyChangedSignal('Value'):connect(function()
ds1:SetAsync(player.UserId,stam.Value)
print("save "..stam.Value)
end)
aura:GetPropertyChangedSignal('Value'):connect(function()
ds1:SetAsync(player.UserId,aura.Value)
print("save "..aura.Value)
end)
end)

8 comments
But would i just keep it in server script service in a script or move it to a local script?
Data stores don't work in localscripts
So yes, keep it in ServerScriptService
dpark for some reason the everytime one of the value increases the other increases 2
well they do if i were to rejoin
What is the point of line 1?
line 7
You defined player on line 6, so no need to write line 1.