kapsel598 Posted July 8, 2012 Author Share Posted July 8, 2012 im new with visual basic and i have this error:http://postimage.org/image/ifhe4vi4p/please tell me what i do wrong or what i must add to fix this.this is my own scriptthanks Link to comment Share on other sites More sharing options...
Joyce Posted July 8, 2012 Share Posted July 8, 2012 You forgot to add brackets behind the command, when you use Call, you MUST always add brackets like () behind the command, even if it has no parameters. Link to comment Share on other sites More sharing options...
Synergy Posted July 8, 2012 Share Posted July 8, 2012 What on Earth is FishRand? o.OAnd, like Joyce said, it needs to be:```Call FishRand ()``` Link to comment Share on other sites More sharing options...
kapsel598 Posted July 8, 2012 Author Share Posted July 8, 2012 when i try add () it dissapear Link to comment Share on other sites More sharing options...
Joyce Posted July 8, 2012 Share Posted July 8, 2012 Ah, I just noticed FishRand is a variable. Why are you calling a Variable? (Since you're assigning a value to it earlier). I think you meant to call a sub there, but you made a mistake somewhere? Link to comment Share on other sites More sharing options...
kapsel598 Posted July 8, 2012 Author Share Posted July 8, 2012 I am a beginner in VB I mean that random from 1 to 3 (rand) if one and I'm level 10 and get the item if you do not have a level 10 again random Link to comment Share on other sites More sharing options...
Joyce Posted July 8, 2012 Share Posted July 8, 2012 Sadly, it doesn't work that way.. :P Can you copy and paste the code on here so I can change it accordingly? Link to comment Share on other sites More sharing options...
kapsel598 Posted July 8, 2012 Author Share Posted July 8, 2012 it is edited http://www.touchofdeathforums.com/smf2/index.php/topic,64806.msg694102.html#msg694102if you used fish item(recipe) (you must have tool and 1 item)>! If Item(GetPlayerEquipment(Index, Weapon)).FTool = Item(GetPlayerInvItemNum(Index, invNum)).FToolReq Then ' Give the resulting item If HasItem(Index, FItem1) Then FishRand = rand(1, 3) If FishRand = 1 Then If GetPlayerLevel(Index) = 10 Then Call PlayerMsg(Index, "1", Red) Else Call FishRand End If End If If FishRand = 2 Then If GetPlayerLevel(Index) = 15 Then Call PlayerMsg(Index, "2", Red) Else Call FishRand End If End If If FishRand = 3 Then If GetPlayerLevel(Index) = 20 Then Call PlayerMsg(Index, "3", Red) Else Call FishRand End If End If Link to comment Share on other sites More sharing options...
Joyce Posted July 8, 2012 Share Posted July 8, 2012 Question, why do you want to to re-randomize? Because the way you explain it you might as well do it this way:```If HasItem(Index, FItem1) Then Select Case GetPlayerLevel(Index) Case 10 ' Hand out the item Case 15 ' Hand out the Item Case 20 ' Hand out the Item End Select End If```because your intended code would always end up giving the level appropriate item anyway. (Note that this will NOT allow you to catch fish when your level is anything other than those levels, which is another weird thing I don't get with your idea?)or the following if you want it to hand out the items between levels as well:``` If HasItem(Index, FItem1) Then Select Case GetPlayerLevel(Index) Case 1 To 9 ' Hand out the item Case 10 To 14 ' Hand out the Item Case 15 To 20 ' Hand out the Item End Select End If``` Link to comment Share on other sites More sharing options...
kapsel598 Posted July 8, 2012 Author Share Posted July 8, 2012 Thank you, i remember it for the future Link to comment Share on other sites More sharing options...
Joyce Posted July 8, 2012 Share Posted July 8, 2012 If it's not what you were trying to do please say so, so I can adjust it accordingly xD 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