Code:
symbols
thing powerup local
thing player local
int bin=62 local
flex shield local
flex damage local
sound pickupsnd=helthpu1.wav local
sound outsnd=SCAlarm.wav local
sound respawnsnd=Activate01.wav local
material mat0=invis.mat local
model oldModel local
model iModel=invis.3do local
message touched
message taken
message damaged
message respawn
message newplayer
end
# ========================================================================================
code
touched:
MaterialAnim(mat0, 50, 1);
player = GetSourceRef();
oldModel = GetThingModel(player);
powerup = GetSenderRef();
TakeItem(powerup, player);
Return;
# ........................................................................................
taken:
player = GetSourceRef();
powerup = GetSenderRef();
shield = 200;
Print("Invis-O-suit");
// Do effects.
PlaySoundThing(pickupsnd, powerup, 1.0, -1, -1, 0);
AddDynamicTint(player, 0.0, 0.0, 0.2);
// Make the player model to the "invis-o-mode" model.
SetThingModel(player, iModel);
SetInvActivated(player, bin, 1);
// Effect lasts 30 seconds, expand if already on.
Return;
# ........................................................................................
respawn:
powerup = GetSenderRef();
PlaySoundThing(respawnsnd, powerup, 0.6, 5.0, 10.0, 0);
Return;
# ........................................................................................
newplayer:
if(IsInvActivated(player, bin))
{
SetInv(player, bin, 1.0);
SetInvActivated(player, bin, 0);
}
Return;
#..............
damaged:
damage = GetParam(0);
if(shield > 0)
{
AddDynamicTint(player, 0, damage/100, damage/100);
shield = shield - damage;
if(shield < 0) {
damage = -shield;
SetInv(player, bin, 1.0);
SetInvActivated(player, bin, 0);
Print("Shield Suit has run out of energy");
PlaySoundLocal(outsnd, 1.0, 0.0, 0); }
else {
damage = 0;
jkStringClear();
jkStringConcatAsciiString("Your Shield Suit's energy level is at ");
jkStringConcatFlex(shield);
jkStringOutput();
jkStringClear(); }
}
ReturnEx(damage);
return;
endok, it changes my model, but none of the damage reducing parts work...and it beeps like a regular supershield after a while(thats what it replaces) even though i didnt tell it to!
------------------
-GB
easy as linkid=1 linkid=2 linkid=3!
before you judge some one, walk a mile in their shoes, they you will be a mile away...and have their shoes.
I'm just an old man with a skooma problem.