Blockland Forums > Modification Help
Wallet's Scripting Class episode III: Revenge of the Script
<< < (19/23) > >>
PVC Potato Gun:
Last class day is today :(

Looking forward to Minigame Basics and Game/Website Communications though.
Uxie:
Not really last class. It's just the last time he's gonna make the doc.

Also why does this have a syntax error. :(
package Airtime
function servercmdairtime(%client, %failsafe, %word1) {
   %airtime = 1;
   %scale = 3;
   %vec = %client.player.getEyeVector();
   while(%airtime <= %word1 && %failsafe < %word1) {
      %client.player.addvelocity(vectorScale(%vec, %scale));
      %airtime++;
      %failsafe++;
      commandToClient(%client, 'bottomprint', "%airttime", 1);
   }
}
activatepackage(Airtime);
Little script I've been working. on. B)
I need a little help with it. It's a little flying script.

Edit: Oh right there's a syntax error at

Add-Ons/Script_Airtime/server.cs Line: 2 - Syntax error.
>>> Some error context, with ## on sides of error halt:
ackage Airtime

function ##s##ervercmdairtime(%client, %failsafe, %word1) {

^%airtime = 1;

^%scale = 3;

^%vec = %client.player.getEyeVector();

^while(%airtime <= %word1 && %failsafe < %word1) {

^^%client.player.addvelocity(vectorScale(%vec, %scale));

^^%airtime++;

^^%failsafe++;
heedicalking:
package Airtime needs a { and a close };


package Airtime
{
function servercmdairtime(%client, %failsafe, %word1) {
   %airtime = 1;
   %scale = 3;
   %vec = %client.player.getEyeVector();
   while(%airtime <= %word1 && %failsafe < %word1) {
      %client.player.addvelocity(vectorScale(%vec, %scale));
      %airtime++;
      %failsafe++;
      commandToClient(%client, 'bottomprint', "%airttime", 1);
   }
}
};
activatepackage(Airtime);
Uxie:
Err, I've never seen packages do that. And why would there be two }'s? I understand the }; now, though.

Nevermind, how did I not realize.
Mr. Wallet:
heedicalking's solution would have been immediately recognizable had he properly used white space to indent all his brackets.  :cookieMonster:
Navigation
Message Index
Next page
Previous page

Go to full version