| Blockland Forums > Modification Help |
| Basic Skateboard (Jumping + Straight Tires) |
| (1/4) > >> |
| Uxie:
I am having trouble with two things in my Skateboard. First, How do I make none of the tires show turning animation, but still have it turn? Second, How do I get The skateboard to jump? I got this from the Hoverboard and put it in my Skateboard script. --- Code: ---function hov::onCollision(%this,%obj,%col,%vec,%speed) { // Collision with other objects, including items Parent::onDamage(%this, %obj); } function hov::onAdd(%this,%obj) { %obj.playThread(0,"Action"); } function StaticShapeData::create(%block) { %obj = new StaticShape() { dataBlock = %block; }; return(%obj); } function ServerCmdOllie(%client) { %pmount = %client.player.getObjectMount(); %vec2 = %pmount.getForwardVector(); %vec2 = VectorNormalize(%vec2); %vec2 = VectorScale(%vec2, 15); Checkheight(%client, %pmount); if($Pref::Server::Midollie){ %client.ollie = 1; } if(%pmount.getDataBlock().getname() $= "hovVehicle"){ if(!%client.ollie) return; %vec3 = %pmount.getposition(); %client.ollie = 0; %vec = VectorAdd(%pmount.getposition(), "0 0" SPC 10); %vec = VectorAdd(%vec, %vec2); %vec = VectorSub(%vec, %vec3); %vec = VectorNormalize(%vec); %vec = VectorScale(%vec, 30); %pmount.setVelocity(%vec); }else{ messageclient(%client,"","You are not on a Hoverboard."); } } function CheckHeight(%client, %obj) { %Zspeed = getWord(%obj.getvelocity(), 2); if(%Zspeed < 0.35 && %Zspeed > -1.5) { %client.ollie = 1; }else{ %client.ollie = 0; } } function ServerCmdNitro(%client) { %pmount = %client.player.getObjectMount(); if(%pmount.getDataBlock().GetName() $= "hovVehicle"){ if(%client.nitro){ messageclient(%client,"","You do not have Nitro charged."); return; } %vec = %pmount.getForwardVector(); %vec = VectorAdd(%vec, "0 0" SPC 0.3); %vec = VectorNormalize(%vec); %vec = VectorScale(%vec, 65); %pmount.setVelocity(%vec); %client.nitro = 1; schedule(3500,0,"Nitroit",%client); }else{ messageclient(%client,"","You are not on a Hoverboard."); } } function Nitroit(%client) { %client.Nitro = 0; } function hovVehicle::OnTrigger(%this, %obj, %triggerNum, %val) { if(%val){ if(%triggerNum == 2){ ServerCmdollie(%obj.spawnbrick.client); } } } function ServerCmdToggleMidollie(%client) { if(%client.issuperadmin || %client.isadmin) { if($pref::server::Midollie){ $pref::server::Midollie = 0; messageAll('','Midollie is now disabled!'); }else{ $pref::server::Midollie = 1; messageall('','Midollie now enabled!'); } } } --- End code --- Then I changed it up for mine. --- Code: ---function bskateboard::onCollision(%this,%obj,%col,%vec,%speed) { // Collision with other objects, including items Parent::onDamage(%this, %obj); } function ServerCmdjump(%client) { %pmount = %client.player.getObjectMount(); %vec2 = %pmount.getForwardVector(); %vec2 = VectorNormalize(%vec2); %vec2 = VectorScale(%vec2, 8); Checkheight(%client, %pmount); if($Pref::Server::Midjump){ %client.jump = 1; } if(%pmount.getDataBlock().getname() $= "bskateboardVehicle"){ if(!%client.jump) return; %vec3 = %pmount.getposition(); %client.jump = 0; %vec = VectorAdd(%pmount.getposition(), "0 0" SPC 12); %vec = VectorAdd(%vec, %vec2); %vec = VectorSub(%vec, %vec3); %vec = VectorNormalize(%vec); %vec = VectorScale(%vec, 12); %pmount.setVelocity(%vec); }else{ messageclient(%client,"","You are not on a Basic Skateboard."); } } function CheckHeight(%client, %obj) { %Zspeed = getWord(%obj.getvelocity(), 2); if(%Zspeed < 0.35 && %Zspeed > -1.5) { %client.jump = 1; }else{ %client.jump = 0; } } function bskateboardVehicle::OnTrigger(%this, %obj, %triggerNum, %val) { if(%val){ if(%triggerNum == 2){ ServerCmdjump(%obj.spawnbrick.client); } } } --- End code --- The skateboard does jump like I want it to. But It somehow disables the hoverboard. When I try to jump on the Hoverboard, it says "You are not on a Hoverboard" Why? |
| Pew446:
It's because you are using serverCmdOllie for both scripts. Change one. |
| Uxie:
I changed mine to servercmdjump a few times. Still failed. |
| Tyler66:
Also, after leaving the server and rejoining you could not jump on your skateboard. Respawning it would not work either. This would require a whole new brick placement. |
| Uxie:
What? Okay, Changed to jump. But still fails. |
| Navigation |
| Message Index |
| Next page |