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

What went wrong with my tool to money script when they leave?

Asked by 8 years ago

There is no error.

01local DSService = game:GetService('DataStoreService'):GetDataStore('Hamburger223232')
02game.Players.PlayerAdded:connect(function(plr)
03    -- Define variables
04    local uniquekey = 'id-'..plr.userId
05    local leaderstats = Instance.new('IntValue', plr)
06    local savevalue =  Instance.new('IntValue')
07    leaderstats.Name = 'leaderstats'
08    savevalue.Parent = leaderstats
09    savevalue.Name = 'Tokens'
10 
11    -- GetAsync
12    local GetSaved = DSService:GetAsync(uniquekey)
13    if GetSaved then
14        savevalue.Value = GetSaved[1]
15    else
View all 41 lines...
0
You aren't giving much of an explanation. The only error I see looking directly at it is you attempting to add 50,100, and 150 directly to a table instance. Shawnyg 4330 — 8y
0
Why are you saving different things with the same key? and "Savetable = Savetable+50" will error as its a table. User#5423 17 — 8y
0
You also don't need to create a table. You can make it a regular integer. Shawnyg 4330 — 8y

Answer this question