Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I add Save Data in leaderstats here?

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

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)

2 comments

0

no i mean Save Data/datastore, i know how to do leaderstats.

0

Your answer is completely off-topic, but I figured it out myself. (not to be rude)

This discussion is preserved as it was. New answers, comments, and votes are closed.