I need help with setting Data for new players. Once the new player has joined for the 2nd time the data will work but for some reason when they’re new and join for the 1st time the data doesn’t load the default data
I’ve tried everything I can but I don’t know how to fix this.
I use Datastore2
Help will be appreciated!
local function DataUpdate(value)
local value = PlayerData:Get(settings.DefaultData)
money.Value = value["Money"]
gfx.Value = value["Settings"]["GFX"]
ctrllock.Value = value["Settings"]["CTRLLock"]
muteboombox.Value = value["Settings"]["MuteBoombox"]
crew.Value = value["Settings"]["Crew"]
sedan.Value = value["Vehicles"]["Sedan"]
armoredtruck.Value = value["Vehicles"]["Armored Truck"]
glock.Value = value["Guns"]["Glock"]["Value"]
sglock.Value = value["Guns"]["Silenced Glock"]["Value"]
mp5.Value = value["Guns"]["MP5"]["Value"]
mac10.Value = value["Guns"]["MAC10"]["Value"]
m1Garand.Value = value["Guns"]["M1 Garand"]["Value"]
akm.Value = value["Guns"]["AKM"]["Value"]
m4a1.Value = value["Guns"]["M4A1"]["Value"]
end
DataUpdate(settings.DefaultData)
PlayerData:OnUpdate(DataUpdate)