DreadX13 Posted December 18, 2009 Author Share Posted December 18, 2009 i got a mining fishing script followed the tut, the mining works great. But i cant seem to get the fishing to work. This is what i have in my main file.Sub GoMining(index, item, maxlevel, name) Dim m Dim level level = maxlevel + 1 If GetPlayerlevel(index) < maxlevel Then m = Int(Rnd * Int(level - GetPlayerLevel(index))) If m = 1 Then Call PlayerMsg(index, GetPlayerName(index) & " found " & name & " amongst the rocks.", 2) Call ReplaceOneInvItem(index, 0, item) Else Call PlayerMsg(index, GetPlayerName(index) & " found nothing interesting!", 12) End If Else Call PlayerMsg(index, GetPlayerName(index) & " found " & name & " amongst the rocks.", 2) Call ReplaceOneInvItem(index, 0, item) End IfEnd SubSub ReplaceOneInvItem(index, olditem, newitem)Dim nn = 1Do If GetPlayerInvItemNum(index, n) = olditem Then Call SetPlayerInvItemNum(index, n, newitem) Call SendInventoryUpdate(index, n) Exit Do End If n = n + 1Loop Until n > 24End SubSub GoFishing(index, item, maxlevel, name) Dim c Dim level level = maxlevel + 1 If GetPlayerlevel(index) < maxlevel Then c = Int(Rnd * Int(level - GetPlayerLevel(index))) If c = 1 Then Call PlayerMsg(index, GetPlayerName(index) & " caught a " & name, 2) Call ReplaceOneInvItem(index, 0, item) Else Call PlayerMsg(index, GetPlayerName(index) & " found nothing!", 12) End If Else Call PlayerMsg(index, GetPlayerName(index) & " caught a " & name, 2) Call ReplaceOneInvItem(index, 0, item) End IfEnd Sub' Executes when a player steps onto a scripted tile.Sub ScriptedTile(Index, Script)Select Case ScriptCase 0Call PlayerMsg(Index, "This scripted tile has no apparent use.", WHITE)Exit SubCase 1 dim weapon weapon = GetPlayerWeaponSlot(index) If weapon = 0 Then Call PlayerMsg(index, "You don't have a Pickaxe equiped", 15) ElseIf GetPlayerInvItemNum(index, weapon) = 60 Then Call GoMining(index, 59, 500, "Gold") Else Call PlayerMsg(index, "You don't have a Pickaxe equiped", 15) End IfCase 2 dim weapon weapon = GetPlayerWeaponSlot(index) If weapon = 0 Then Call PlayerMsg(index, "You don't have a Fishing Rod equiped", 15) ElseIf GetPlayerInvItemNum(index, weapon) = 62 Then Call GoFishing(index, 61, 500, Fish) Else Call PlayerMsg(index, "You don't have a Fishing Rod equiped", 15) End IfCase ElseCall PlayerMsg(Index, "No tile script found. Please contact an admin to solve this problem.", WHITE)Exit SubEnd SelectEnd SubWhen I look at it it looks good to me but i need a pros opion. What did i do wrong and how can i fix it. Link to comment Share on other sites More sharing options...
Lam3r Posted December 18, 2009 Share Posted December 18, 2009 Firstly, use the ['code] tags please…And i don't see a problem with it either? If the mining script works fine and all you really did was copy/paste it, what is wrong? What is the problem you're getting? Link to comment Share on other sites More sharing options...
Ruins of Hell Posted December 18, 2009 Share Posted December 18, 2009 Call GoFishing(index, 61, 500, Fish)You neve defined fish.Make it in quote marks.Also shouldn't Rnd be Rand? 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