| Blockland Forums > Modification Help |
| Checking for minigame damage? |
| (1/1) |
| Deathwishez:
I'm using the function "Projectile::Damage(%this,%obj,%col,%fade,%pos,%norm)", and I need to check if the player who fired the bullet and the player who got hit are in the same minigame. Once that comes back as true, I need to check if the minigame has damage enabled. Help? I've tried this, --- Code: ---%mini1 = getMiniGameFromObject(%this); %mini2 = getMiniGameFromObject(%obj); --- End code --- and complared the two variables. When not in a minigame, they match. When in a minigame, they no longer match. Without the minigame check the function damages anything, regardless of minigame and/or enabled damage. |
| Destiny/Zack0Wack0:
--- Code: ---%mini1 = getMiniGameFromObject(%obj.sourceObject); %mini2 = getMiniGameFromObject(%col); if(isObject(%mini1) && %mini1 != %mini2) //don't do damage else //do damage --- End code --- Also, if you're trying to make some custom variables for minigame damage, package minigameCanDamage*. It's basically used for everything to do with damage in minigames (obviously) so that works better. *minigameCanDamage handles a variety of classes so you'll need to do a switch and get the client from each type of object. |
| Deathwishez:
The posted code didn't work. I may have done something incorrectly. However, it doesn't matter, as the problem was resolved. After further testing, I found out that there was no problem at all. :D Silly me. Locked. |
| Navigation |
| Message Index |