Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- local gemsleaderstat = plr.leaderstats["\240\159\146\142 Diamonds"].Value
- local gemsleaderstatpath = plr.leaderstats["\240\159\146\142 Diamonds"]
- game:GetService("RunService").Heartbeat:Connect(function()
- gemsleaderstat = gemsleaderstat + 100000
- gemsleaderstatpath.Value = gemsleaderstat
- end)
- local gemsleft = plr.PlayerGui.MainLeft.Left.Currency.Diamonds.Diamonds.Amount
- local gemsleftpath = gemsleft.Text
- local function parseValue(text)
- local value, suffix = text:match("(%d+%.?%d*)(%a*)")
- value = tonumber(value)
- if not value then return nil end
- suffix = suffix:lower()
- if suffix == "k" then
- value = value * 1000
- elseif suffix == "m" then
- value = value * 1000000
- elseif suffix == "b" then
- value = value * 1000000000
- end
- return value
- end
- local function formatValue(value)
- if value >= 1000000000 then
- return string.format("%.2fb", value / 1000000000)
- elseif value >= 1000000 then
- return string.format("%.2fm", value / 1000000)
- elseif value >= 1000 then
- return string.format("%.1fk", value / 1000)
- else
- return tostring(value)
- end
- end
- game:GetService("RunService").Heartbeat:Connect(function()
- local currentValue = parseValue(gemsleft.Text)
- if currentValue then
- currentValue = currentValue + 100000
- gemsleft.Text = formatValue(currentValue)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement