Blockland Forums > Modification Help
Corp's Errors and questions thread. I need some coding help here!
The Corporation:
Fixed OP, need help here.
New thing.
I want the FOV of this weapon to change when it's switched to ironsights.
But I've managed to adjust it to a good point, and now thats all I need.
--- Code: ---offset = "-0.2 0.3 0"; //-Left +Right, -Back +Front, -Down +Up
eyeOffset="-0.1103 0.49 -0.1565"; //-Left +Right, -Back +Front, -Down +Up
--- End code ---
Another thing I'm having a problem with is weapon spread-
I'm trying to get it to work a certain way-
Waist fire-Not accurate at all
Crouch Waist Fire-still not as accurate
Scoped-Accurate
Crouched scoped-Accurate as crap
And whenever the player is moving, they can't shoot for crap.
--- Code: ---unction MK11Fire(%this,%obj,%slot,%spread,%shellcount,%recoil)
{
if(%obj.isCrouched()==1)
{
%spread=%spread-0.1;
%recoil=%recoil/2;
}
if(vectorLen(%obj.getVelocity()) >= 0.1 && !isObject(%obj.getObjectMount()))
{
%spread=%spread+0.1;
}
%vector=%obj.getMuzzleVector(%slot);
%p=new Projectile()
{
dataBlock=MK11Recoil;
initialVelocity=%obj.getVelocity();
initialPosition=%obj.getEyePoint();
sourceObject=%obj;
sourceSlot=%slot;
yclient=%obj.client;
};
for(%shell=0;%shell<%shellcount;%shell++)
{
%x=(getRandom()-0.5)*10.415926*%spread;
%y=(getRandom()-0.5)*10.415926*%spread;
%z=(getRandom()-0.5)*10.415926*%spread;
%p=new Projectile()
}
--- End code ---
Plornt:
You forgot the semi colon at the end of the line above that.
--- Code: ---^verticalImpulse=1;
^explosion=##M##K11bulletExplosion;
--- End code ---
The Corporation:
--- Quote from: Plornt on March 04, 2012, 03:32:11 PM ---You forgot the semi colon at the end of the line above that.
--- Code: ---^verticalImpulse=1;
^explosion=##M##K11bulletExplosion;
--- End code ---
--- End quote ---
well how did i miss that...
I'll keep this topic up just in case I have any more problems.
jes00:
A lot of times the error will be above the line with ##
The Corporation:
New thing, check the OP.