| Blockland Forums > Modification Help |
| Change datablock help + static help |
| (1/4) > >> |
| Derroith:
Simple question, why doesnt this work? --- Code: ---datablock PlayerData(SpeedArmor : PlayerStandardArmor) { runForce = 100 * 90; runEnergyDrain = 0; minRunEnergy = 0; maxForwardSpeed = 15; maxBackwardSpeed = 15; maxSideSpeed = 15; maxForwardCrouchSpeed = 3; maxBackwardCrouchSpeed = 2; maxSideCrouchSpeed = 2; minJetEnergy = 0; jetEnergyDrain = 0; canJet = 0; uiName = ""; showEnergyBar = false; runSurfaceAngle = 45; jumpSurfaceAngle = 45; }; datablock ItemData(SpeedSyringe) { category = "Weapon"; // Mission editor category className = "Weapon"; // For inventory system // Basic Item Properties shapeFile = "./DRSYRINGE.dts"; rotate = true; mass = 1; density = 0.1; elasticity = 0.1; friction = 0.8; emap = true; //gui stuff uiName = "Speed Syringe (Static)"; doColorShift = false; // Dynamic properties defined by the scripts canDrop = true; }; function SpeedSyringeItem::onPickup(%this, %obj, %col) { %obj.changedatablock(PlayerSpeedArmor); } --- End code --- Doesnt appear to work, help! On the other hand, I need help with static items, if you dont know what that is, well its an item that you pickup and use instantly, for example the TF2 medkits or the Sanvich. So if anyone can help me with that too, like item dropping and that, please do! |
| aml:
I'm not the best at scripting but I think --- Code: ---%obj.changedatablock(PlayerSpeedArmor); --- End code --- Should just be --- Code: ---%obj.changedatablock("SpeedArmor"); --- End code --- |
| Derroith:
--- Quote from: aml on August 17, 2011, 07:43:38 PM ---I'm not the best at scripting but I think --- Code: ---%obj.changedatablock(PlayerSpeedArmor); --- End code --- Should just be --- Code: ---%obj.changedatablock("SpeedArmor"); --- End code --- --- End quote --- I'll have a go at it. Thanks. |
| Derroith:
Bump- --- Quote from: Derroith on August 17, 2011, 07:54:31 PM ---I'll have a go at it. --- End quote --- Doesn't work :/ |
| Placid:
as normal, make sure there's no syntax errors and such, but i think you know that. try changing your datablock to the speed datablock (add a uiName for a little bit) and enter in the console echo(findclientbyname("yourname").player.datablock.getName()); and post the results. |
| Navigation |
| Message Index |
| Next page |