Thread: [PI] How do I make a Npc only attackable by Donators?

Results 1 to 5 of 5
  1. #1 [PI] How do I make a Npc only attackable by Donators? 
    Registered Member 2nubs1cup's Avatar
    Join Date
    Jan 2013
    Posts
    972
    Thanks given
    77
    Thanks received
    90
    Rep Power
    15
    I want to make it where if you're not a donator and you attempt to attack a npc, it won't let you and will say "you must be a donator in order to attack this npc". I added the donator zone for the npc but just incase I want to also add this so people can't cheat.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jul 2014
    Posts
    9
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Look for the initial NPC attack process, the id of the npc should be passed in for you. So add a check right at the beginning of it.

    Something along the lines of..
    if(npcId == #){
    if (!player.rights == DONATOR){
    sendmessage(donate bxtch!!);
    return;
    }
    }
    Reply With Quote  
     

  3. #3  
    Registered Member 2nubs1cup's Avatar
    Join Date
    Jan 2013
    Posts
    972
    Thanks given
    77
    Thanks received
    90
    Rep Power
    15
    Quote Originally Posted by Benjanim View Post
    Look for the initial NPC attack process, the id of the npc should be passed in for you. So add a check right at the beginning of it.

    Something along the lines of..
    I tried adding it in my attacknpc class, and it says npcid cannot be resolved to a variable and for c.donator == 0 it says cannot be resolved or is not a field.
    Reply With Quote  
     

  4. #4  
    Registered Member 2nubs1cup's Avatar
    Join Date
    Jan 2013
    Posts
    972
    Thanks given
    77
    Thanks received
    90
    Rep Power
    15
    Quote Originally Posted by Benjanim View Post
    Look for the initial NPC attack process, the id of the npc should be passed in for you. So add a check right at the beginning of it.

    Something along the lines of..
    Dont worry, I got it working now, thank you.
    Reply With Quote  
     

  5. #5  
    Registered Member Lil Peep's Avatar
    Join Date
    Oct 2012
    Posts
    881
    Thanks given
    234
    Thanks received
    58
    Rep Power
    0
    Quote Originally Posted by Benjanim View Post
    Look for the initial NPC attack process, the id of the npc should be passed in for you. So add a check right at the beginning of it.

    Something along the lines of..
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. PI how do i make a npc don't move
    By loruviam in forum Help
    Replies: 8
    Last Post: 03-06-2014, 05:45 AM
  2. Replies: 10
    Last Post: 08-25-2012, 04:01 PM
  3. Replies: 1
    Last Post: 04-05-2012, 09:46 AM
  4. Replies: 3
    Last Post: 08-05-2011, 11:04 PM
  5. Replies: 4
    Last Post: 07-22-2010, 02:51 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •