#first attempt at coding in roblox studios and i have no idea what this error code means...

1 messages · Page 1 of 1 (latest)

pseudo pilot
#
local Player = Players.LocalPlayer

local currencyGUI = script.Parent
local currencyHolderFrame = currencyGUI:FindFirstChild("CurrencyHolder")
local foodFrame = currencyHolderFrame:FindFirstChild("Food")
local coinsFrame = currencyHolderFrame:FindFirstChild("Coins")

repeat wait(1) until Player.leaderstats

local function changeValue(name: string, amount: number)
    if name == "Food" then 
        foodFrame.Amount.Text = amount.."/50"
    elseif name == "Coins" then
        coinsFrame.Amount.Text = amount
    end
    
end


changeValue("Food", Player.leaderstats.Food.Value)
changeValue("Coins", Player.leaderstats.Coins.Value)

Player.leaderstats.Food.Changed:Connect(function()
    changeValue("Food", Player.leaderstats.Food.Value)
end)
Player.leaderstats.Food.Changed:Connect(function()
    changeValue("Coins", Player.leaderstats.Coins.Value)
end)```

(sorry if its the wrong tags ngl idk what tags this would follow)
#

i've attempted to solve it and yet i keep getting the same error

#

but i dont see anything else wrong when the code works as everything loads as it should

#

so idk if i should ignore that error or not