Thread: Looking for...
View Single Post
  #15  
Old 10-22-2009, 07:42 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Scouser View Post
:O
Hmm, so i know this is the rookiest question uve probably heard but...
If i was to make a script like Jerret's, would that script be put into 1 of the NPC's in an actual level via graal level editor? or would it be added via a weapon on the RC.
I was also wondering on how you would setup a command such as
if i wanted a GUI to pop up when i say /gang or whatever.
like a trigger i guess.
Weapon scripts are primarily for Systems and so on like GUIs.

Commands in weapon scripts can be done using:

PHP Code:
//This also works on the serverside
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/command") {
    
player.chat "."// Clears Chat 
    
doWhatever();      // Performs Command
  
}

or (my preferred way for weapon scripts)

PHP Code:
//This only works on the clientside.
//#CLIENTSIDE
function ChatBar.onAction() {
  if (
ChatBar.text == "/command") {
    
ChatBar.text ""// Deletes Text from ChatBar
    
doCommand();       // Performs Command
  
}

The door script I posted above would typically go in a class script and you would have the level scripts join that class if you plan on re-using it multiple times.

If you're unaware of class scripts or how to use them, you can get away with just putting the script in a level npc.
__________________
Quote:

Last edited by fowlplay4; 10-22-2009 at 08:42 PM..
Reply With Quote