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

How do I add Save Data in leaderstats here?

Asked by 3 years ago

Here is the code I have:

01game.Players.PlayerAdded:Connect(function(player)
02    local leaderstats = Instance.new("Folder")
03    leaderstats.Name = "leaderstats"
04    leaderstats.Parent = player
05 
06    local Searches = Instance.new("IntValue")
07    Searches.Name = "Searches"
08    Searches.Value = 0
09    Searches.Parent = leaderstats
10 
11    local Cash = Instance.new("IntValue")
12    Cash.Name = "Cash"
13    Cash.Value = 0
14    Cash.Parent = leaderstats
15end)

all the tutorials i've watched don't work, please help

1 answer

Log in to vote
0
Answered by 3 years ago

i think this should be ok but the script's parent have to be ServerScriptService

01game.Players.PlayerAdded:Connect(function(player)
02 
03playersLeft = playersLeft + 1
04 
05    local leaderstats = Instance.new("Folder")
06    leaderstats.Name = "leaderstats"
07    leaderstats.Parent = player
08 
09    local Searches = Instance.new("IntValue")
10    Searches.Name = "Searches"
11    Searches.Value = 0
12    Searches.Parent = leaderstats
13 
14    local Cash = Instance.new("IntValue")
15    Cash.Name = "Cash"
16    Cash.Value = 0
17    Cash.Parent = leaderstats
18end)
0
no i mean Save Data/datastore, i know how to do leaderstats. NickyPlayz2011 82 — 3y
0
Your answer is completely off-topic, but I figured it out myself. (not to be rude) NickyPlayz2011 82 — 3y
Ad

Answer this question