Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-17-2003, 10:08 AM
wildwog2001 wildwog2001 is offline
Registered User
Join Date: Mar 2002
Location: Brisbane, Australia
Posts: 27
wildwog2001 is on a distinguished road
Send a message via AIM to wildwog2001
Question Small NPC Help please

I made a small npc so as long as the player had this npc in his/her inventory they could say like /add 10 gralet etc..... yet i dont know how to do it so that its if the player has the weapon, i knowh owt o do it if its weaponfired but not by chat if they are holding the weapon yet i can do it while it is on the ground somewhere in the level. can anyone please explain to me the certain commands I can use to get it to work for when the player is holding the weapon.

__________________
Reply With Quote
  #2  
Old 09-17-2003, 01:21 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
playerchats, same as if it were on the ground.
__________________

Reply With Quote
  #3  
Old 09-17-2003, 02:26 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
hasweapon(name) perhaps?
Reply With Quote
  #4  
Old 09-17-2003, 03:44 PM
SaijinGohan SaijinGohan is offline
Registered User
SaijinGohan's Avatar
Join Date: Jul 2001
Location: U.S.A - Ohio
Posts: 536
SaijinGohan is on a distinguished road
Send a message via AIM to SaijinGohan Send a message via MSN to SaijinGohan
I'm a little confused on what you mean. You want a weapon that drops things only when its a weapon and you have it?

NPC Code:

if (playerchats && isweapon) {
if (strequals(#c,/add 10 gralet)) {
dostuffhere;
}
}



Is that around what you need?
__________________

Job: A Legend

And you think that you have played Graal forever? Ha!
Reply With Quote
  #5  
Old 09-17-2003, 05:09 PM
wildwog2001 wildwog2001 is offline
Registered User
Join Date: Mar 2002
Location: Brisbane, Australia
Posts: 27
wildwog2001 is on a distinguished road
Send a message via AIM to wildwog2001
Im not sure if what you said was what i needed but

hasweapon

ended up working and this was my final script

if (playertouchsme){
toweapons Stuff Adder!;
}
if (hasweapon(Stuff Adder!)) if (playerchats&&
strequals(#c,Add 1000)){
players[index].rupees+=1000;
}

but for some reason it adds 2000?
__________________
Reply With Quote
  #6  
Old 09-17-2003, 05:38 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Because you say it several times. Try using "setplayerprop #c,;" after players[index].rupees+=1000. Maybe it also could be useful using tokenize to define how much the player wants.
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #7  
Old 09-17-2003, 09:39 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
Quote:
Originally posted by wildwog2001
Im not sure if what you said was what i needed but

hasweapon

ended up working and this was my final script

if (playertouchsme){
toweapons Stuff Adder!;
}
if (hasweapon(Stuff Adder!)) if (playerchats&&
strequals(#c,Add 1000)){
players[index].rupees+=1000;
}

but for some reason it adds 2000?
don't put events (aka playerchats) within other code blocks.
__________________

Reply With Quote
  #8  
Old 09-17-2003, 10:52 PM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
You also need to use if (playerchats) before if (hasweapon()).
__________________
Former Global Scripting Team Member


Reply With Quote
  #9  
Old 09-18-2003, 12:51 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally posted by wildwog2001
Im not sure if what you said was what i needed but

hasweapon

ended up working and this was my final script

if (playertouchsme){
toweapons Stuff Adder!;
}
if (hasweapon(Stuff Adder!)) if (playerchats&&
strequals(#c,Add 1000)){
players[index].rupees+=1000;
}

but for some reason it adds 2000?
Wouldn't be better change players[index].rupees+=1000 by playerrupees+=1000?
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.