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