I’ve tried reading about DataStores, then trying to make one myself. No luck. It doesn’t work at all. Sometimes it gives an error, and sometimes it doesn’t. I’ve been trying for about a whole day now and it’s extremely annoying. I’ve asked before and not much helped. I always had to go back to square one, either because my entire game broke or nothing worked.
I don’t know what I’m doing wrong.
I want to save these stats and load them when the player joins.
local function onPlayerJoin(player) local leaderstats = Instance.new("Folder",player) leaderstats.Name = "leaderstats" leaderstats.Parent = player local statistics = Instance.new("Folder",player) statistics.Name = "statistics" statistics.Parent = player local moneyStat = Instance.new("IntValue",leaderstats) moneyStat.Name = "Money" moneyStat.Value = 0 moneyStat.Parent = leaderstats local multiplierStat = Instance.new("IntValue",leaderstats) multiplierStat.Name = "Multiplier" multiplierStat.Value = 1 multiplierStat.Parent = leaderstats local maxAmountStat = Instance.new("IntValue",statistics) maxAmountStat.Name = "RandomAmountMax" maxAmountStat.Value = 5 maxAmountStat.Parent = statistics local minAmountStat = Instance.new("IntValue",statistics) minAmountStat.Name = "RandomAmountMin" minAmountStat.Value = 1 minAmountStat.Parent = statistics
I’m so close to giving up on learning Lua.