Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local Player = Players.LocalPlayer
- local PlayerGui = Player.PlayerGui
- local Gui = PlayerGui:WaitForChild("MainUI")
- local Frame = Gui.Frame
- local CoinsLabel = Frame.Coins.Label
- local Leaderstats = Player:WaitForChild("leaderstats")
- local CoinLeaderstat = Leaderstats:WaitForChild("Coins")
- local function CoinsChanged(changedAmount)
- CoinsLabel.Text = "Coins: " .. tostring(changedAmount)
- end
- CoinsChanged(CoinLeaderstat.Value)
- CoinLeaderstat.Changed:Connect(function(changedAmount)
- CoinsChanged(changedAmount)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement