Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-04-2011, 03:37 AM
xuntasi xuntasi is offline
Registered User
xuntasi's Avatar
Join Date: Jun 2011
Location: Deadaccountsville, Internet
Posts: 14
xuntasi is on a distinguished road
How to script chat-operated weapons?

Ok, so I am deeply confused about how to script weapons that are affected by player chat. I made this script, and it is operated by chat commands, but when I make it a weapon it doesn't work. I've literally been sitting at my computer for over 2 hours now stuck on this one script. It works perfectly when made into a regular NPC, but it doesn't do jack as a weapon. I'm not asking for anyone to give me any script, I just need advice on what commands I should change to make this a weapon (or just a script that will work in all levels, not necessarily a weapon. Really the only problem now is that it only works in the room with the NPC.)

Here is my script:
PHP Code:
function onPlayerChats() {
  if(
player.chat.starts("/shonmessage ") && player.account=="Graal780973") {
    
shon.mess player.chat.substring("/shonmessage ".length());
    echo(
"Shonspeak message set to "@shon.mess);
  }
  if(
player.chat.starts("/shonaccount ") && player.account=="Graal780973") {
    
shon.acc findplayer(player.chat.substring("/shonaccount ".length()));
    echo(
"Shonspeak target set to "@shon.acc.account);
  }
  if(
player.chat=="/shonspeak" && player.account=="Graal780973") {
  
shon.acc.chat shon.mess;
  }

Any advice as to what I should do?
__________________
This account is DEAD!
Reply With Quote
 


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:37 PM.


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