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

attempt to index nil leaderstats? [closed]

Asked by 4 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.
local currencyName = "Cash"

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

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

    local currency = Instance.new("IntValue")
    currency.Name = currencyName
    currency.Parent = folder

    local currency = Instance.new("IntValue")
    currency.Name = ("Potatoes")
    currency.Parent = folder
end)

0
local currencyName = "Cash" 02 03 game.Players.PlayerAdded:Connect(function(player) 04 05 local folder = Instance.new("Folder") 06 folder.Name = ("leaderstats") 07 folder.Parent = player 08 09 local currency = Instance.new("IntValue") 10 currency.Name = currencyName 11 currency.Parent = folder 12 13 local currency = Instance.new("IntValue") 14 currency.Name Cats767_99 -68 — 4y
0
This is barely any information for us to use. Please show us the adding/subtracting code. raid6n 2196 — 4y

Closed as Non-Descriptive by Leamir

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?