| Blockland Forums > Modification Help |
| Checkpoint Triggers |
| (1/1) |
| Swollow:
--- Code: ---//==================== // SwollowCheckPoint //==================== datablock TriggerData(SwollowCheckPointTrigger) { tickPeriodMS = 50; }; function SwollowCheckPointTrigger::onEnterTrigger(%this,%trigger,%obj) { Parent::onEnterTrigger(%this,%trigger,%obj); } function SwollowCheckPointTrigger::onLeaveTrigger(%this,%trigger,%obj) { Parent::onLeaveTrigger(%this,%trigger,%obj); } function SwollowCheckPointTrigger::onTickTrigger(%this,%trigger, %obj) { if(!(%obj.getType() & $TypeMasks::PlayerObjectType)) { return; } %client = %obj.client; if(!isObject(%client)) { return; } centerPrint(%obj.client,"CheckPoint Reached!",2); %client.SwollowcheckPoint = %this; %client.SwollowcheckPointPos = %this.getPosition(); Parent::onTickTrigger(%this,%trigger); } package SwollowCheckpointPackage { function GameConnection::getSpawnPoint(%client) { if(isObject(%client.SwollowcheckPoint)) return (%client.SwollowcheckPoint.getSpawnPoint()); return Parent::getSpawnPoint(%client); } }; activatePackage(SwollowCheckpointPackage); --- End code --- I'm trying to make a checkpoint with triggers but so far the getSpawnPoint isn't working |
| Amade:
Change --- Code: ---return (%client.SwollowcheckPoint.getSpawnPoint()); --- End code --- to --- Code: ---return (%client.SwollowcheckPoint.getTransform()); --- End code --- |
| Swollow:
--- Quote from: Amade on September 25, 2011, 08:58:58 PM ---Change --- Code: ---return (%client.SwollowcheckPoint.getSpawnPoint()); --- End code --- to --- Code: ---return (%client.SwollowcheckPoint.getTransform()); --- End code --- --- End quote --- thanks amade :D |
| Navigation |
| Message Index |