|
| 28 Nov 2013 09:37 AM |
I'm having an issue with an if statement. Early in the script I state this:
local scriptversion = 14 local AutoUpdate = true
Then at the end I'm trying to do this:
if AutoUpdate and tonumber(game.MarketplaceService:GetProductInfo(135477047).Description:sub(10,11)) > scriptversion then print "Admin Commands Update Available" end
And it fetches me the following error:
Workspace.AdammAdminCommands:2496: attempt to compare nil with number
Am I doing tonumber() wrong? Or am I missing something? Thanks! |
|
|
| Report Abuse |
|
|
GGGGG14
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25344 |
|
|
| 28 Nov 2013 09:39 AM |
You're using a few complex things that I don't think you have a grasp on yet.
I see you're defining things and using conditional statements, but I think you need to review your basic syntactical errors like:
print "Admin Commands Update Available", should BE: print("Admin Commands Update Available") |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2013 09:43 AM |
The print was just me trying to make my post shorter and cut to the chase. Sorry about that.
Oddly, if I type this into studio it gets the number 15 from the description:
print(tonumber(game.MarketplaceService:GetProductInfo(135477047).Description:sub(10,11)))
I still don't get why my script isn't catching it as a number. |
|
|
| Report Abuse |
|
|
| |
|
mic144
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 1598 |
|
|
| 28 Nov 2013 10:04 AM |
That won't work.
-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ -- |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2013 10:05 AM |
| @mic What won't work? Try try it. |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2013 10:07 AM |
| Gah forget it. I just decided to get rid off all the variables and what-not. It added 2 lines to my script, but I guess it works. |
|
|
| Report Abuse |
|
|
mic144
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 1598 |
|
|
| 28 Nov 2013 10:08 AM |
Because one, you're using Khol's Admin and two, you'd have to try to set that to a variable: version = .Description:sub(10,11) actualversion = tostring(version)
-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ -- |
|
|
| Report Abuse |
|
|
mic144
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 1598 |
|
|
| 28 Nov 2013 10:11 AM |
And three, I shouldn't even be helping you for taking credit for what Khol did. Leave now, I help people who actually need help.
-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ -- |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2013 10:44 AM |
@mic I already fix my problem.
And no, I'm not taking credit in any form. Kohl was banned, and his script is breaking. I am simply fixing it and adding commands. We all know who Kohl is. Nobody can replace him. |
|
|
| Report Abuse |
|
|
mic144
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 1598 |
|
|
| 28 Nov 2013 10:46 AM |
Then in reality that script should be "Khols Admin Commands Modified" not Adamms Admin Commands, that's taking credit.
-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ -- |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2013 10:50 AM |
| I credit Kohl in the description. |
|
|
| Report Abuse |
|
|
mic144
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 1598 |
|
|
| 28 Nov 2013 10:52 AM |
You're taking credit in the title, no one reads the description now - a - days.
-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ -- |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2013 10:55 AM |
Well nobody reading the description nowadays is the reader's fault. Not mine.
Still credited him in a pretty obvious place. If I were mean I could have credited him in a note in the middle of the 2.5k line script. |
|
|
| Report Abuse |
|
|
mic144
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 1598 |
|
|
| 28 Nov 2013 10:58 AM |
You just want to seem cool for people you don't even know right?
You: OGM GET MY ADMINZ I SKRIPT SKILLS (Replaces Khols name with Adamm) Friend: OGM U SO COOL ADAMM HOW U DO THIS You: I scripted this entire thing on my own, are you impressed? ;)
-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ -- |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2013 11:03 AM |
Why would I do that? Everyone knows who Kohl is. And I credit him.
And I am committed to Dazzle Cheer Squad. I don't go talk to strangers like an idiot. |
|
|
| Report Abuse |
|
|
mic144
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 1598 |
|
|
| 28 Nov 2013 11:06 AM |
Define "Everybody" You would do that because you want to see cool infront of your virtual or real life friends.
-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ -- |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2013 11:12 AM |
GGGGG14 (I think there is five 'G's), using print like that would work. If you are formatting, however, you would need the parenthesis. |
|
|
| Report Abuse |
|
|
mic144
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 1598 |
|
|
| 28 Nov 2013 11:15 AM |
What?
-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ -- |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2013 11:18 AM |
@mic You spelled seem wrong :P
And everyone is anyone who has seen "Kohl's Admin House" on the front page, plus the 100860 people who have taken his script.
I don't want to look cool. I'm only on here to learn how to write programs and support my groups. |
|
|
| Report Abuse |
|
|
mic144
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 1598 |
|
|
| 28 Nov 2013 11:20 AM |
Lol no. You don't learn by taking credit for scripts You want to look cool for your clan.. Get out please, we don't fix free models here.
-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ -- |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2013 11:56 AM |
Lol no. I don't take credit for scripts. And I don't want a higher reputation.. Get out please, we don't accept accusers here. |
|
|
| Report Abuse |
|
|
mic144
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 1598 |
|
|
| 28 Nov 2013 11:57 AM |
'we' You aren't even a scripter yet, bro read my siggy.
-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ -- |
|
|
| Report Abuse |
|
|
|
| 28 Nov 2013 12:02 PM |
| You think I can't script? Challenge me. |
|
|
| Report Abuse |
|
|
mic144
|
  |
| Joined: 14 Oct 2009 |
| Total Posts: 1598 |
|
|
| 28 Nov 2013 12:09 PM |
Like I said, get on my level. Once you start making your OWN scripts I'll consider challenging you.
-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ -- |
|
|
| Report Abuse |
|
|