Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i make a variable to hold infinity numbers?

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)

2 comments

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 ;)

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"

1 answer

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)

2 comments

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

0

simply you can use math.huge then

This discussion is preserved as it was. New answers, comments, and votes are closed.