Author Topic: need helps from the pros.  (Read 2339 times)

Hi. Will anyone be willing to help me?
If so, can you teach me how to make a script. A script like irk's challange. When sometimes it says
"No helping the noobies" in a area. I die and that sentince pops up. How can i do that?

If you want to kill someone when they enter an area use triggers.

It's a few lines of code :) Nothing hard.

If you want to kill someone when they enter an area use triggers.

It's a few lines of code :) Nothing hard.

i mean how do i make a tigger where some sentince pops up

Same, use a trigger but instead of killing them print a message.

This is how you make a trigger:
Code: [Select]
datablock TriggerData(NameOfMyTrigger)
{
   tickPeriodMS = 100; // Don't worry about this
};

function NameOfMyTrigger::onEnterTrigger(%data, %trig, %obj)
{
   // This is what happens when someone enters your trigger
   // %trig is the exact trigger that someone entered
   // %obj is the person / thing that entered the trigger

   messageClient(%obj.client, '', 'Hi');
}

function NameOfMyTrigger::onLeaveTrigger(%data, %trig, %obj)
{
   // No need to do anything if they leave the trigger, i guess...
}

Then you just spawn one and set it's size and position.
You can use the editor to do that, or do it through the console:
Quote
==> new Trigger(SomeTrigger) { dataBlock = "NameOfMyTrigger"; };
==> $myPlayer = ClientGroup.getObject(0).player;
==> SomeTrigger.setPosition( $myPlayer.getPosition() );
==> SomeTrigger.setScale("5 5 5");
« Last Edit: April 12, 2008, 04:27:21 PM by exidyne »

And the code to kill somebody is?

%obj.kill(); ?
« Last Edit: April 12, 2008, 05:07:55 PM by tails »

This is how you make a trigger:
Code: [Select]
datablock TriggerData(NameOfMyTrigger)
{
   tickPeriodMS = 100; // Don't worry about this
};

function NameOfMyTrigger::onEnterTrigger(%data, %trig, %obj)
{
   // This is what happens when someone enters your trigger
   // %trig is the exact trigger that someone entered
   // %obj is the person / thing that entered the trigger

   messageClient(%obj.client, '', 'Hi');
}

function NameOfMyTrigger::onLeaveTrigger(%data, %trig, %obj)
{
   // No need to do anything if they leave the trigger, i guess...
}

Then you just spawn one and set it's size and position.
You can use the editor to do that, or do it through the console:
Quote
==> new Trigger(SomeTrigger) { dataBlock = "NameOfMyTrigger"; };
==> $myPlayer = ClientGroup.getObject(0).player;
==> SomeTrigger.setPosition( $myPlayer.getPosition() );
==> SomeTrigger.setScale("5 5 5");

Thanks, I couldn't remember the trigger's object otherwise I would of told him how to make a trigger.



How helpful of you!  :cookieMonster:

At least I gave him the general idea in stead of insulting him.