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 2 years ago

Here is the code I have:

game.Players.PlayerAdded:Connect(function(player)
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    local Searches = Instance.new("IntValue")
    Searches.Name = "Searches"
    Searches.Value = 0
    Searches.Parent = leaderstats

    local Cash = Instance.new("IntValue")
    Cash.Name = "Cash"
    Cash.Value = 0
    Cash.Parent = leaderstats
end)

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

1 answer

Log in to vote
0
Answered by 2 years ago

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

game.Players.PlayerAdded:Connect(function(player)

playersLeft = playersLeft + 1

    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    local Searches = Instance.new("IntValue")
    Searches.Name = "Searches"
    Searches.Value = 0
    Searches.Parent = leaderstats

    local Cash = Instance.new("IntValue")
    Cash.Name = "Cash"
    Cash.Value = 0
    Cash.Parent = leaderstats
end)
0
no i mean Save Data/datastore, i know how to do leaderstats. NickyPlayz2011 82 — 2y
0
Your answer is completely off-topic, but I figured it out myself. (not to be rude) NickyPlayz2011 82 — 2y
Ad

Answer this question