Author Topic: /\ Need help!  (Read 3465 times)

Hai,
I started torque scripting, and i need a little help, Tell me what i did wrong?

https://www.mediafire.com/?d04g2kbyu6nei0k
Or view it here:


serverCmdSky(%client)
{
if(isObject(%client.player) {
}
%client.player.setVelocity("0 0 200");
}


Code: [Select]
function serverCmdSky(%client)
{
      if(isObject(%client.player))
      {
            %client.player.setVelocity("0 0 200");
      }
}
First of all. You always start a function with the word function. Next, you closed the if statement before adding the velocity.
« Last Edit: December 05, 2013, 10:56:13 AM by jes00 »

Code: [Select]
function serverCmdSky(%client)
{
      if(isObject(%client.player)
      {
            %client.player.setVelocity("0 0 200");
      }
}
First of all. You always start a function with the word function. Next, you closed the if statement before adding the velocity.
if(isObject(%client.player)) - You forgot a )

Looking good so far. Just those minor mistakes those guys pointed out above.

Yea.. The code dosn't work.. at all.



https://www.mediafire.com/?ev917fugq7zn9ul
View it,

Tell me what is wrong please, It still doesn't work .-.

Yea.. The code dosn't work.. at all.



https://www.mediafire.com/?ev917fugq7zn9ul
View it,

Tell me what is wrong please, It still doesn't work .-.

Stop uploading 3 lines of code to mediafire. Noone can be assed to download it.

Code: [Select]
function serverCmdSky(%client)
{
      if(isObject(%client.player))
      {
            %client.player.addVelocity("0 0 100");
      }
}

I'm not sure but I think that the addVelocity goes in order from X Y Z so saying /sky would make him move on the plane instead of up.

Code: [Select]
function serverCmdSky(%client)
{
      if(isObject(%client.player))
      {
            %client.player.addVelocity("0 0 100");
      }
}

I'm not sure but I think that the addVelocity goes in order from X Y Z so saying /sky would make him move on the plane instead of up.
Z points up.

So, What's the corrected code?

So, What's the corrected code?

This

Code: [Select]
function serverCmdSky(%client)
{
      if(isObject(%client.player))
      {
            %client.player.addVelocity("0 0 100");
      }
}

How do i make it so when they do /sky it gives a command?

How do i make it so when they do /sky it gives a command?
What do you mean "it gives a command"?


I mean a message :3
Use messageClient(%client, '', "My message here.");

function serverCmdSkydive(%client)
{
      if(isObject(%client.player))
      {
            %client.player.addVelocity("0 0 100");
      }
}
function serverCmdYo
Use messageClient(%client, '', "Yo.");

Will this work?