Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't this datastore script store data?

Asked by
Knqe 23
5 years ago

I'm not getting any errors from the script (I removed the pcalls to make sure) Can someone help me out?

01local ds = game:GetService("DataStoreService"):GetDataStore("ds")
02 
03game.Players.PlayerAdded:Connect(function(plr)
04    local key = "id-"..plr.UserId
05    local Stats = Instance.new("Folder",plr)
06    local Lvl = Instance.new("IntValue",Stats)
07    local Exp = Instance.new("IntValue",Stats)
08    local Exc = Instance.new("IntValue",Stats)
09    local Pts = Instance.new("IntValue",Stats)
10    local Arm = Instance.new("IntValue",Stats)
11    local Dmg = Instance.new("IntValue",Stats)
12    local Rei = Instance.new("IntValue",Stats)
13    Stats.Name = "Stats"
14    Lvl.Name = "Lvl"
15    Exp.Name = "Exp"
View all 64 lines...

1 answer

Log in to vote
0
Answered by
Knqe 23
5 years ago

Solved my own issue. I'm not sure what the problem was, but I changed a lot and fixed the issue.

0
Anyways don't use the second parameter for Instance.New. https://devforum.roblox.com/t/psa-dont-use-instance-new-with-parent-argument/30296 XviperIink 428 — 5y
Ad

Answer this question