| Blockland Forums > Modification Help |
| Script breaks activations? |
| (1/3) > >> |
| aml:
Fixed that problem. |
| MegaScientifical:
onTrigger is used for activating, and you aren't parenting it, so it no longer works. Parent. |
| aml:
Well that fixed the activation part, but it still doesn't display the message. |
| aml:
Well I started to mess with the code a bit more, and it broke the activation again. I Parented and Packaged it. --- Code: ---datablock PlayerData(PlayerTest : PlayerStandardArmor) { minJetEnergy = 100; canJet = 0; rechargeRate = 3.0; uiName = "Test Player"; showEnergyBar = 1; }; datablock PlayerData(PlayerTestInvisible : PlayerStandardArmor) { minJetEnergy = 100; jetEnergyDrain = 5; canJet = 0; maxForwardSpeed = 0; maxBackwardSpeed = 0; maxSideSpeed = 0; maxForwardCrouchSpeed = 0; maxBackwardCrouchSpeed = 0; maxSideCrouchSpeed = 0; canRide = 0; uiName = ""; }; package testplayer { function Armor::onTrigger(%obj,%trigger,%val) { if(%trigger == 4) { if(%obj.getDatablock().getName() $= "PlayerTest" && %val == 1) { %obj.changeDatablock(PlayerTestInvisible); %obj.hidenode("All"); } else if(%obj.getDatablock().getName() $= "PlayerTestInvisible" && %val == 0) { %obj.changeDatablock(PlayerTest); %obj.unhideNode("All"); } } Parent::onTrigger(%obj,%trigger,%val); } }; activatepackage(testplayer); --- End code --- |
| aml:
Bump. |
| Navigation |
| Message Index |
| Next page |