Blox Fruits part 10
..unknown
lua
10 months ago
1.3 kB
7
Indexable
local button = script.Parent
local player = game.Players.LocalPlayer
local function updateCash()
local leaderstats = player:FindFirstChild("leaderstats")
if leaderstats then
local cash = leaderstats:FindFirstChild("Cash")
if cash then
button.Text = "Cash: " .. cash.Value
end
end
end
-- Update the button text when cash changes
local leaderstats = player:WaitForChild("leaderstats", 5)
if leaderstats then
local cash = leaderstats:WaitForChild("Cash", 5)
if cash then
cash.Changed:Connect(updateCash)
updateCash() -- Set initial value
end
end Editor is loading...
Leave a Comment