adamsharp Posted August 8, 2009 Author Share Posted August 8, 2009 can someone please debug this script for me plz?```Case "/dice1" Dim D1 D1 = Rand(1,5) If D1 = 1 Then Call PlayerMsg(Index, "You Rolled 1 Out Of 5", BLUE) Call GiveCurrency(index, 1, 100) Else If D1 = 2 Then Call PlayerMsg(Index, "You Rolled 2 Out Of 5", BLUE)Else If D1 = 3 Then Call PlayerMsg(Index, "You Rolled 3 Out Of 5", BLUE)Else If D1 = 4 Then Call PlayerMsg(Index, "You Rolled 4 Out Of 5", BLUE)Else If D1 = 5 Then Call PlayerMsg(Index, "You Rolled 5 Out Of 5", BLUE) End IfExit Sub```Thanks. Link to comment Share on other sites More sharing options...
DrNova Posted August 8, 2009 Share Posted August 8, 2009 To clarify, his /help and other commands arent working, this is the only thing he edited in his main.txt so far so it might be thr problem. Link to comment Share on other sites More sharing options...
adamsharp Posted August 8, 2009 Author Share Posted August 8, 2009 @DrNova:> To clarify, his /help and other commands arent working, this is the only thing he edited in his main.txt so far so it might be thr problem.thank you for saying drnova Link to comment Share on other sites More sharing options...
Owen F Posted August 8, 2009 Share Posted August 8, 2009 each one should exit sub once it is done, otherwise it does not know what to do.Also it should be ElseIfThere for:```Case "/dice1" Dim D1 D1 = Rand(1,5) If D1 = 1 Then Call PlayerMsg(Index, "You Rolled 1 Out Of 5", BLUE) Call GiveCurrency(index, 1, 100) Else If D1 = 2 Then Call PlayerMsg(Index, "You Rolled 2 Out Of 5", BLUE)Else If D1 = 3 Then Call PlayerMsg(Index, "You Rolled 3 Out Of 5", BLUE)Else If D1 = 4 Then Call PlayerMsg(Index, "You Rolled 4 Out Of 5", BLUE)Else If D1 = 5 Then Call PlayerMsg(Index, "You Rolled 5 Out Of 5", BLUE) End IfExit Sub```should be```Case "/dice1" Dim D1 D1 = Rand(1,5) If D1 = 1 Then Call PlayerMsg(Index, "You Rolled 1 Out Of 5", BLUE) Call GiveCurrency(index, 1, 100)Exit Sub ElseIf D1 = 2 Then Call PlayerMsg(Index, "You Rolled 2 Out Of 5", BLUE)Exit SubElseIf D1 = 3 Then Call PlayerMsg(Index, "You Rolled 3 Out Of 5", BLUE)Exit SubElseIf D1 = 4 Then Call PlayerMsg(Index, "You Rolled 4 Out Of 5", BLUE)Exit SubElse Call PlayerMsg(Index, "You Rolled 5 Out Of 5", BLUE) End IfExit Sub``` Link to comment Share on other sites More sharing options...
xelander Posted August 8, 2009 Share Posted August 8, 2009 ```Case "/dice1" Dim D1 D1 = Rand(1,5) If D1 = 1 Then Call PlayerMsg(Index, "You Rolled 1 Out Of 5", BLUE) Call GiveCurrency(index, 1, 100) Else If D1 = 2 Then Call PlayerMsg(Index, "You Rolled 2 Out Of 5", BLUE)Else If D1 = 3 Then Call PlayerMsg(Index, "You Rolled 3 Out Of 5", BLUE)Else If D1 = 4 Then Call PlayerMsg(Index, "You Rolled 4 Out Of 5", BLUE)Else If D1 = 5 Then Call PlayerMsg(Index, "You Rolled 5 Out Of 5", BLUE) End IfExit Sub```Really nice one you did.I just edited some minor minor synax errors.I made a really looking script once, the first like i though you copied mine. xDEdit: I got body slamd.I though it was space bettwen Else and If, but yah. Link to comment Share on other sites More sharing options...
adamsharp Posted August 8, 2009 Author Share Posted August 8, 2009 thank you people. Link to comment Share on other sites More sharing options...
Owen F Posted August 8, 2009 Share Posted August 8, 2009 Lol.Before you use mine, adam, please allow me to edit one last thing. The last ElseIf should merely be Else. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now