TopbarPlus leaderstats

Hello everyone! :wave::slightly_smiling_face:

So I’ve been trying to make a leaderstats icon with TopbarPlus on the basis of what I’ve seen in the uncopylocked place, but I’m getting an error every time.

The error:

The script:

local localPlayer = game:GetService("Players").LocalPlayer
local playerGui = localPlayer.PlayerGui
local replicatedStorage = game:GetService("ReplicatedStorage")
local iconModule = replicatedStorage.Icon
local Icon = require(iconModule)
local IconController = require(iconModule.IconController)
local Themes = require(iconModule.Themes)

task.spawn(function()
	while true do
		wait(10)
		--game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
		wait(10)
		--game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
	end
end)
--game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
--game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
--game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, false)

Icon.new()
	:setName("Coins")
	:setRight()
	:lock()
	:setSize(100, 32)
	:call(function(icon)
		local NumberSpinner = require(replicatedStorage.NumberSpinner)
		local labelSpinner = NumberSpinner.new()
		icon:convertLabelToNumberSpinner(labelSpinner)
		labelSpinner.Name = "LabelSpinner"
		labelSpinner.Decimals = 3
		labelSpinner.Duration = 0.25
		while wait(0.5) do
			labelSpinner.Value = localPlayer:WaitForChild("leaderstats"):WaitForChild("Coins").Value
		end
end)

Is there a way to get this working?

1 Like

It’s unclear what the exact issue is here without being able to see the code within iconModule. Based on the error, all I can deduce is that :call is not working because it isn’t defined within the module. If this is something you added yourself, double-check within the module (or whatever source you used to write this code) to find out why :call isn’t defined or why it’s unable to be referenced in your script.

1 Like

local localPlayer = game:GetService(“Players”).LocalPlayer
local playerGui = localPlayer.PlayerGui
local replicatedStorage = game:GetService(“ReplicatedStorage”)
local marketplaceService = game:GetService(“MarketplaceService”)
local iconModule = replicatedStorage.Icon
local Icon = require(iconModule)
local IconController = require(iconModule.IconController)
local Themes = require(iconModule.Themes)

– Stats
local TIME = localPlayer.leaderstats.Time

IconController.setGameTheme(Themes.BlueGradient)

Icon.new()
:setName(“CashSpinnerIcon”)
:setMid()
:setRight()
:lock()
:setSize(100, 32)
:call(function(icon)
local NumberSpinner = require(replicatedStorage.NumberSpinner)
local labelSpinner = NumberSpinner.new()
icon:convertLabelToNumberSpinner(labelSpinner)
labelSpinner.Name = “LabelSpinner”
labelSpinner.Decimals = 0
labelSpinner.Duration = 0.5
while wait(TIME) do
labelSpinner.Value = TIME.Value
end
end)

1 Like