/
spirzen
/
it-code-examples
Обзор
Документация
Войти
/
spirzen
/
it-code-examples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/lua/lab-1141-006/main.lua
32 строки
877 B
Spirzen
Code migration pack
09 июн 2026, 01:41
09 июн 2026, 01:41
cebc284
Код
Авторство
О чём код?
--!strict local Players = game:GetService("Players") local player = Players.LocalPlayer local label = script.Parent :: TextLabel local function updateCoins() local leaderstats = player:FindFirstChild("leaderstats") local coins = leaderstats and leaderstats:FindFirstChild("Coins") :: IntValue? if coins then label.Text = "Монеты: " . tostring(coins.Value) end end local function hookCoins() local leaderstats = player:WaitForChild("leaderstats", 10) if not leaderstats then warn("leaderstats не найден за 10 с") return end local coins = leaderstats:WaitForChild("Coins", 10) :: IntValue? if not coins then return end updateCoins() coins.Changed:Connect(updateCoins) end player.CharacterAdded:Connect(hookCoins) if player:FindFirstChild("leaderstats") then hookCoins() end