I wanted to make a quest system in my game so I tried to add a saving leaderstat. I tried 3 Scripts, and none of them worked. This is the last script I tried:
local dataStore = game:GetService(“DataStoreService”):GetDataStore(“MoneyData”)
starterMoney = 0
local leaderstats = Instance.new(“Folder”)
leaderstats.Name = “questvalues”
leaderstats.Parent = plr
local money = Instance.new(“IntValue”)
money.Name = “quest1”
money.Value = dataStore:GetAsync(plr.UserId) or starterMoney
money.Parent = leaderstats
The IntValue is there but it isn’t saving. How can I fix this problem?
Note: The folder’s name isn’t leaderstats because I don’t want the leaderstat to show up on the leaderboard.
Also Sorry if I made a mistake in English.