willunited Posted August 3, 2012 Author Share Posted August 3, 2012 If i am 11 lvl above of the npc,dont drop item.I need this system.Please. Link to comment Share on other sites More sharing options...
Ruins of Hell Posted August 3, 2012 Share Posted August 3, 2012 [What have you tried?](http://whathaveyoutried.com)The actual problem is quite simple, but from now on, you should be prepared to show us what you have tried that didn't work, or what you have searched for.Here's how you get the level of a player:```GetPlayerLevel(index)```Here's how you get the level of an NPC:```NPC(npcNum).Level ' or npcNum's equivalent, depending on where you are.```Here's the part of the code that deals with handing out items (Sub PlayerAttackNpc server-side):``` 'Drop the goods if they get it n = Int(Rnd * Npc(npcNum).DropChance) + 1 If n = 1 Then Call SpawnItem(Npc(npcNum).DropItem, Npc(npcNum).DropItemValue, mapNum, MapNpc(mapNum).Npc(mapNpcNum).x, MapNpc(mapNum).Npc(mapNpcNum).y) End If```now replace the above with this:``` 'Drop the goods if they get it n = Int(Rnd * Npc(npcNum).DropChance) + 1 If n = 1 And GetPlayerLevel(attacker) - Npc(npcNum).Level < 11 Then Call SpawnItem(Npc(npcNum).DropItem, Npc(npcNum).DropItemValue, mapNum, MapNpc(mapNum).Npc(mapNpcNum).x, MapNpc(mapNum).Npc(mapNpcNum).y) End If```Done. Link to comment Share on other sites More sharing options...
willunited Posted August 3, 2012 Author Share Posted August 3, 2012 Tyvm man.I understand about GetPlayerLevel. 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