| Blockland Forums > Modification Help |
| Can't change the player's datablock all right and proper. |
| << < (3/5) > >> |
| Giovan:
Thanks. |
| Chrono:
--- Quote from: Human Reaper on March 24, 2011, 03:06:52 PM ---You need to parent and package it if your using damage. --- End quote --- Parent in a package calls the original function. EMPImage::onFire shouldn't already exist in the default scripts, so he couldn't want that. Parent outside of a package calls the parent class function, in this case, WeaponImage::onFire, which would play the standard shooting function. Even Weapon_Gun has a similar onFire format. In fact, it wouldn't be any different if he changed his code to function EMPImage::onFire(%this,%obj,%slot) { GunImage::onFire(%this,%obj,%slot); } Now you know. Here you go Giovan. --- Code: ---function EMPProjectile::Damage(%this,%obj,%col,%fade,%pos,%normal) { if(%col.getType() & $TypeMasks::PlayerObjectType) { %col.changeDataBlock(PlayerNoJet); if(isObject(%col.client)) %col.client.applyBodyColors(); if(%col.getMountedObject(0)) %col.getMountedObject(0).getDataBlock().doDismount(%col.getMountedObject(0)); } } --- End code --- This will make sure no one is still mounted if the player was originally a horse. I could be wrong on the slot, please correct me. |
| Giovan:
I don't think it's working. I jump up high and shoot it down. It bounces up and hits me. I see the explosion effect on myself. I can still jet. I'm using Copy-Paste exactly chrono's code. Any help? |
| Chrono:
Do you have Self Damage turned on in the minigame? |
| Giovan:
I wasn't running a minigame at the time. Do I need to? |
| Navigation |
| Message Index |
| Next page |
| Previous page |