Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make a variable to hold infinity numbers?

Asked by
PropzFx 27
5 years ago

im trying to make so a variable can hold infinity numbers or the numbers (1,100) so i can concatenate the numbers with a string.

Heres my code

game.Players.PlayerAdded:Connect(function(player)
    player.Chatted:Connect(function(message)
        for i, adminName in pairs(admins) do
            if player.Name == adminName then
                money = tonumber(1,1111)
                if message == "/setmoney " .. money then
                        player.leaderstats.Money.Value = player.leaderstats.Money.Value + money

                end
            end
        end
    end)
end)

i get this error bad argument #2 to 'tonumber' (base out of range)

i have done some research and im starting to realize that i shouldnt use tonumbers. But i cant find what i need to use

(sry for my english ;P)

0
Or you could simply use ("math.huge") for a very large number, you can also create a loop which never ends to keep the number at math.huge forever ;) AIphanium 124 — 5y
0
Unless you have infinite memory, that isn't possible. Also "infinity numbers" (probably including 1e+100) is very different from 0-100. There is also no "base 1111" hiimgoodpack 2009 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

maybe you are saying:

game.Players.PlayerAdded:Connect(function(Player)
    Player.Chatted:Connect(function(Message)
        for i, adminName in pairs(admins) do
            if player.Name == adminName then
                if Message.sub(1,10) == "/setmoney " then
                    local MoneyWant = tonumber(Message.sub(10))
                    Player.leaderstats.Money.Value = Player.leaderstats.Money.Value + MoneyWant
                end
            end
        end
    end)
end)
0
Already know that way but i want to know how to make a variable hold infinity numbers cuz im going to add a targetplayer later PropzFx 27 — 5y
0
simply you can use math.huge then Mitumitu17YN -5 — 5y
Ad

Answer this question