| Blockland Forums > Modification Help |
| Adding an event to a spawned brick |
| (1/3) > >> |
| MARBLE MAN:
I was messing around with one of my old scripts kinda like BrianSmith's tron soo I wanted to make it kill vehicles when it touches them I looked at JVS and the Mining Mod for the event thing/kill person jvs is $JVS::Content::Type::eventInput[0] = "\"onActivate\""; repeated and changed Mning is function minelava::mined(5this, %client, %brick, %mode) sooo I wanted some help with adding it here: %brick = new fxDTSBrick() { datablock = brick1x1fData; position = vectorAdd(%pos,"0 0 -0.3"); isPlanted = 1; colorID = %obj.client.currentColor; colorfxid = 3; }; if(!isObject(BrickGroup_10103)) { new SimGroup(BrickGroup_10103) { bl_id = 10103; name = "MARBLE MAN"; }; MainBrickGroup.add(BrickGroup_10103); } %brick.setTrusted(1); %brick.plant(); BrickGroup_10103.add(%brick); %trans = %obj.getTransform(); %obj.setTransform(getWords(%trans,0,1) SPC getWord(%pos,2) - 0.05 SPC getWords(%trans,3)); %obj.VehicleTrail = %brick; } Please help me add the event "onvehicletouch" "vehicle" "destroy" EDIT I need help making the bricks be the operator(person who activated the script)'s bricks. I also need help making the bricks kill players who have a different ID. Could anyone give advice? |
| Port:
From Brick_Checkpoint: --- Code: ---function brickCheckpointData::onPlant(%data, %obj) { %obj.enableTouch = true; %enabled = 1; %delay = 0; %inputEvent = "OnPlayerTouch"; %target = "Self"; %outputEvent = "PlaySound"; %par1 = Beep_Popup_Sound.getId(); %obj.addEvent(%enabled, %delay, %inputEvent, %target, %outputEvent, %par1); } --- End code --- Figure out the rest yourself. |
| MARBLE MAN:
--- Quote from: Port on May 12, 2012, 09:46:54 PM ---From Brick_Checkpoint: --- Code: ---function brickCheckpointData::onPlant(%data, %obj) { %obj.enableTouch = true; %enabled = 1; %delay = 0; %inputEvent = "OnPlayerTouch"; %target = "Self"; %outputEvent = "PlaySound"; %par1 = Beep_Popup_Sound.getId(); %obj.addEvent(%enabled, %delay, %inputEvent, %target, %outputEvent, %par1); } --- End code --- Figure out the rest yourself. --- End quote --- *facepalm thanks - i should have thought |
| MARBLE MAN:
You LIE ... This doesnt work... forgot something ........... |
| Port:
If you don't know where to place it or use it in a way that it works, you shouldn't be scripting. |
| Navigation |
| Message Index |
| Next page |