Thread: Make a npc talk

Results 1 to 7 of 7
  1. #1 Make a npc talk 
    Registered Member
    Join Date
    Nov 2010
    Posts
    15
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    So I have been trying for the past 30 mins to get this workin i got the code here for the npc to talk but i keep getting a error message.

    I'm using a project-xile base atm, working on a spawn server right now

    Code:
    if (npcs[i].npcType == NPCID) {
                            if (misc.random2(30) <= 2) {
                                npcs[i].updateRequired = true;
                                npcs[i].textUpdateRequired = true;
                                npcs[i].textUpdate = "Text goes here.";
                            }
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Dec 2010
    Posts
    498
    Thanks given
    41
    Thanks received
    84
    Rep Power
    54
    Can we see the error?
    Reply With Quote  
     

  3. #3  


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    29
    Posts
    9,688
    Thanks given
    1,752
    Thanks received
    3,103
    Rep Power
    5000
    you might be missing a bracket? (you haven't shown us error yet)

    Code:
    if (npcs[i].npcType == the npcs id){ //npc name
                                            if (Misc.random2(timer) <= 3) {
                                                    npcs[i].updateRequired = true;
                                                    npcs[i].forceChat("Message");
                                            }
                                    }
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Nov 2010
    Posts
    15
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    im sorry lemme explain it its says im missing something right here
    Code:
    if (npcs[i].npcType
    just right after it...
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Nov 2010
    Posts
    15
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    says like im missing a ")" but when i give it a try? like it gives me more errors idk i feel dumb atm
    Reply With Quote  
     

  6. #6  


    RS Wiki's Avatar
    Join Date
    Mar 2011
    Age
    29
    Posts
    9,688
    Thanks given
    1,752
    Thanks received
    3,103
    Rep Power
    5000
    NPCHandler.java Under this
    Code:
    					if (npcs[i].walkingHome && npcs[i].absX == npcs[i].makeX && npcs[i].absY == npcs[i].makeY) {
    						npcs[i].walkingHome = false;
    					} else if(npcs[i].walkingHome) {
    						npcs[i].moveX = GetMove(npcs[i].absX, npcs[i].makeX);
    			      		npcs[i].moveY = GetMove(npcs[i].absY, npcs[i].makeY);
    						npcs[i].getNextNPCMovement(i); 
    						npcs[i].updateRequired = true;
    					}
    Add your NPC that you want to shout.
    Code:
    					if (npcs[i].npcType == ####) { //NPC ID here.
    						npcs[i].forceChat("insert your message here");
    					}
    All the best,
    Wiki




    coming soon
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Nov 2010
    Posts
    15
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Quote Originally Posted by RS Wiki View Post
    NPCHandler.java Under this
    Code:
    					if (npcs[i].walkingHome && npcs[i].absX == npcs[i].makeX && npcs[i].absY == npcs[i].makeY) {
    						npcs[i].walkingHome = false;
    					} else if(npcs[i].walkingHome) {
    						npcs[i].moveX = GetMove(npcs[i].absX, npcs[i].makeX);
    			      		npcs[i].moveY = GetMove(npcs[i].absY, npcs[i].makeY);
    						npcs[i].getNextNPCMovement(i); 
    						npcs[i].updateRequired = true;
    					}
    Add your NPC that you want to shout.
    Code:
    					if (npcs[i].npcType == ####) { //NPC ID here.
    						npcs[i].forceChat("insert your message here");
    					}
    thank you soooo much!!
    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. Make npc talk?
    By Rukin1 in forum Help
    Replies: 13
    Last Post: 07-01-2012, 08:47 PM
  2. Make NPC Talk [PI]
    By Flaunter in forum Help
    Replies: 6
    Last Post: 02-18-2012, 05:56 AM
  3. how to make npc talk?
    By mota in forum Help
    Replies: 1
    Last Post: 01-26-2012, 11:20 PM
  4. How to make npc talk/yell
    By piratenpyro in forum Snippets
    Replies: 7
    Last Post: 02-01-2010, 04:15 PM
  5. Void to make NPC's talk?
    By Ecstasy in forum Help
    Replies: 16
    Last Post: 03-09-2009, 11:26 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •