local currencyName = "Credits" local killName = "Kills" local DataStore = game:GetService("DataStoreService"):GetDataStore("Datastore") game.Players.PlayerAdded:Connect(function(player) local folder = Instance.new("Folder") folder.Name = "leaderstats" folder.Parent = player local currency = Instance.new("IntValue") currency.Name = currencyName currency.Parent = folder local kill = Instance.new("IntValue") kill.Name = killName kill.Parent = folder local ID = currencyName.."-"..player.UserId local ID = killName.."-"..player.UserId local savedData = nil pcall(function() savedData = DataStore:GetAsync (ID) end) if savedData ~= nil then currency.Value = savedData kill.Value = savedData print("Data loaded") else currency.Value = 1000 kill.Value = 0 print("New player to the game") end end)
this is my whole script but the script I'm having trouble is this one.
game.Players.PlayerAdded:Connect(function(player) local folder = Instance.new("Folder") folder.Name = "leaderstats" folder.Parent = player
I'm sure this is correct. But why does it not show? I use a normal script in serverscriptservice. There is no other script that block this.
The answer is that an item or a script is making the script not working. I try to leave the file for a few minutes and it doesn't work again. So I make a conclusion is that I need to find the script and remove it.
Your script is correct, this also happens to me. Can you change one of your Int-Values and check if shows?