Blockland Forums > Modification Help

candlelight script

Pages: << < (2/4) > >>

YourBuddyBill:

Ok, among other things, he wants one keybind to makethe player hold the candle (which I would assume to work a lot like the Sit emote, for example; keybind it if you have it)
And it might, I'm workin on it but it'll take me a day or two

Treynolds416:

Cubelands, just package ServerCmdLight(%client)

Cubelands:

I got this Syntax error.


--- Code: ---dd-Ons/Item_Candle_Stick/server.cs Line: 125 - Syntax error.
>>> Some error context, with ## on sides of error halt:

package ServerCmdLight(##%##client)

{

^function serverCmdLight(%client)

^{

   %player = %client.player;

   

   if(%player.getMountedImage(1) == 0)

      %player.mountImage(candlestickImage, 1);

   else if(%player.getMountedImage(1) == candlestickImage.getID())

      %player.unMountImage(1);
--- End code ---


Treynolds416:


--- Code: ---package Candle
{
    function ServerCmdLight(%client)
    {
        //Code here
    }
};
activatePackage(Candle)
--- End code ---


Cubelands:

I changed some client script, remove server lines. I almost got it. I still not understand why key binds still not showed up, It should be worked.


--- Code: ---if(!$candlestick::Binds)
{
$remapDivision[$remapCount] = "Tooggle CandleStick";
$remapName[$remapCount] = "Toggle On/Off";
$remapCmd[$remapCount] = "togglecandlestick";
$remapCount++;
$candlestick::Binds = 1;
}
activatepackage(candle);
datablock ShapeBaseImageData(candlestickImage)
{
   shapeFile = "./CandleStick.dts";
   emap = true;

   mountPoint = 1;

   className = "ItemImage";
   item = BowItem;

   melee = false;

   
LightOn = true;
radius = 5;
brightness = 5;
color = "0.8 0.7 0.4 1";

FlareOn = false;
// FlareTP = true;
// Flarebitmap = "base/lighting/corona";
// FlareColor = "1 1 1";
// ConstantSizeOn = false;
// ConstantSize = 1;
// NearSize = 3;
// FarSize = 0.5;
// NearDistance = 10.0;
// FarDistance = 30.0;
// FadeTime = 0.1;
// BlendMode = 0;

AnimColor = false;
AnimBrightness = true;
AnimOffsets = false;
AnimRotation = false;
LinkFlare = false;
LinkFlareSize = false;
MinColor = "1 1 0";
MaxColor = "0 0 1";
MinBrightness = 0.0;
MaxBrightness = 5.0;
MinRadius = 0.1;
MaxRadius = 10;
StartOffset = "-5 0 0";
EndOffset = "5 0 0";
MinRotation = 0;
MaxRotation = 359;

SingleColorKeys = false;
RedKeys = "AWTCFAH";
GreenKeys = "AWTCFAH";
BlueKeys = "AWTCFAH";

BrightnessKeys = "DEDEDFGF";
RadiusKeys = "AZAAAAA";
OffsetKeys = "AZAAAAA";
RotationKeys = "AZAAAAA";

ColorTime = 1.0;
BrightnessTime = 1.0;
RadiusTime = 1.0;
OffsetTime = 1.0;
RotationTime = 1.0;

LerpColor = false;
LerpBrightness = false;
LerpRadius = false;
LerpOffset = false;
LerpRotation = false;
textureName          = "base/data/particles/cloud";
dragCoefficient      = 1.0;
gravityCoefficient   = -7.0;
inheritedVelFactor   = 0.0;
windCoefficient      = 0.0;
constantAcceleration = 0.0;
lifetimeMS           = 200;
lifetimeVarianceMS   = 0;
spinSpeed     = 0;
spinRandomMin = -90.0;
spinRandomMax =  90.0;
useInvAlpha   = false;

colors[0] = "0.0 0.0 0.0 0.0";
colors[1] = "1   1   0.3 0.0";
colors[2] = "1   1   0.3 1.0";
colors[3] = "0.6 0.0 0.0 0.0";

sizes[0] = 0.0;
sizes[1] = 0.0;
sizes[2] = 0.09;
sizes[3] = 0.01;

times[0] = 0.0;
times[1] = 0.5;
times[2] = 0.51;
times[3] = 0.7;

   ejectionPeriodMS = 1;
   periodVarianceMS = 0;
   ejectionVelocity = 0.0;
   ejectionOffset   = 0.0;
   velocityVariance = 0.0;
   thetaMin         = 0;
   thetaMax         = 180;
   phiReferenceVel  = 0;
   phiVariance      = 360;
   overrideAdvance = false;

   //lifetimeMS = 5000;
   
//actionstuff

stateSequence[0] = "ready";

};
deactivatepackage(candle);

function togglecandlestick(%client)
{
   %player = %client.player;
   
   if(%player.getMountedImage(1) == 0)
      %player.mountImage(candlestickImage, 1);
  $candle::On = true;
  armReady = true;
  clientcmdcenterPrint("\c6CandleStick Mount to left hand (active light, Press L)", 2);
   else if(%player.getMountedImage(1) == candlestickImage.getID())
      %player.unMountImage(1);
  parent::ClientCmdLight(%client);
  $candle::On = false;
  armReady = false;
  clientcmdcenterPrint("\c6CandleStick Unmout from left hand.", 2);
}
}


--- End code ---
I got Syntax error line
armReady = true;
%player.unMountImage(1);
armReady = false;

Pages: << < (2/4) > >>

Go to full version