| Blockland Forums > Modification Help |
| Vehicle Wont Spawn When Brick First Planted |
| (1/1) |
| DYLANzzz:
--- Code: --- function wrenchImage::onHitObject(%this, %player, %a, %brick, %particle, %f) { %client=%player.client; if(%brick.getClassName()$="fxDTSBrick" && %brick.getDatablock().uiName$="Vehicle Spawn") { if(%client.bl_id==%brick.getGroup().bl_id) { //messageClient(%client,"","\c3You hit a vehicle brick, congrats"); //echo("RWVehicle"@%client.RWVehicleDatablock); %vehicle="RWVehicle"@%client.RWVehicleDatablock; messageALL("","\c3%brick.setVehicle("@%vehicle@", %client)"); eval("%brick.setVehicle("@%vehicle@", %client);"); %brick.spawnVehicle(); //return; } else { messageClient(%client,"","Sorry, this isn't your brick"); return; } } Parent::onHitObject(%this, %player, %a, %brick, %particle, %f); } --- End code --- It works if I spawn a vehicle oncee but if I just try to make the brick and then spawn the vehicle with this script it wont spawn anything. FIXED: It seems if I get the ID of the datablock im looking for and not just the name it works (%nameOfDatablock.getId()) |
| Navigation |
| Message Index |