print("Hello All!")
I just found out that sometimes, the value on the leaderstats name is “Value”
In the script I have to set the name on “Money”. And this is causing the game some errors. Sometimes also it duplicates and calls one “Money” and another “Value”.
I also tried to search for a variable called “Value” and rename. But the name is “Money”. It previews as “Value”.
This is a part of the script.
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Wait()
local gam = Instance.new("Folder", plr)
gam.Name = "game"
local osTime = Instance.new('ObjectValue', gam)
osTime.Name = "osTime" -- ignore: antiexploit value!
local leaderstats = Instance.new('Folder', plr)
leaderstats.Name = "leaderstats"
local money = Instance.new("IntValue", leaderstats)
money.Value = ds:GetAsync(plr.UserId) or startamount
money.Name = "Money"
money.Changed:Connect(function()
ds:SetAsync(plr.UserId, money.Value)
end)
spawn(function() -- closed here to dont make it longer