generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: What is wrong with this line?

Previous Thread :: Next Thread 
Francisl4d45 is not online. Francisl4d45
Joined: 14 Aug 2010
Total Posts: 347
18 Nov 2015 02:06 PM
Why doesn't this work? Between 2 and 3 are numbers.

if string.sub(itemslot.AmountNumber.Text, 2, 3) > 1 then
--code
end
Report Abuse
Francisl4d45 is not online. Francisl4d45
Joined: 14 Aug 2010
Total Posts: 347
18 Nov 2015 02:09 PM
Bump
Report Abuse
Francisl4d45 is not online. Francisl4d45
Joined: 14 Aug 2010
Total Posts: 347
18 Nov 2015 02:17 PM
Output says that I can't compare string and number, so how do I make that string to a number?
Report Abuse
LotsOfViolence is not online. LotsOfViolence
Joined: 29 Jun 2011
Total Posts: 8375
18 Nov 2015 02:18 PM
I'm not very good when it comes to things like this..but try the '#'


if string.sub(#itemslot.AmountNumber.Text, 2, 3) > 1 then
--code
end

No idea if it would work.

http://www.roblox.com/Lots-item?id=307049082http://www.roblox.com/Of-item?id=307039670http://www.roblox.com/Violence-item?id=307039720 http://www.roblox.com/--item?id=316030220 | You're going to have a bad time.
Report Abuse
BogyMac is not online. BogyMac
Joined: 04 Nov 2011
Total Posts: 823
18 Nov 2015 02:21 PM
Try:

if tonumber(string.sub(itemslot.AmountNumber.Text,2,3)) > 1 then
--code
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Nov 2015 02:21 PM
no.

Call tonumber
Report Abuse
Francisl4d45 is not online. Francisl4d45
Joined: 14 Aug 2010
Total Posts: 347
18 Nov 2015 02:30 PM
@cntkillme can you write the right command?
Report Abuse
AnimatedUglyPet is not online. AnimatedUglyPet
Joined: 23 Feb 2013
Total Posts: 364
18 Nov 2015 02:38 PM
You're a moron.
Report Abuse
Francisl4d45 is not online. Francisl4d45
Joined: 14 Aug 2010
Total Posts: 347
18 Nov 2015 02:50 PM
@cntkillme thank you, but I found another problem. Why won't this work?

string.sub(slots[a].Name, 1, 5) == "CSlot"

The full name is CSlot1.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
18 Nov 2015 02:51 PM
It will work, you're just doing something wrong.
Report Abuse
Francisl4d45 is not online. Francisl4d45
Joined: 14 Aug 2010
Total Posts: 347
18 Nov 2015 02:56 PM
@cntkillme It just doesn't find a ImageButton that starts from "CSlot" and I have 4 items that start from "CSlot" in the same Parent. There is no error in output.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image