Page 1 of 1

How would I make a paralysis weapon?

Posted: Tue Jan 21, 2014 2:30 pm
by Anakin
is there a way that an weapon causes paralysis for a defined time and amount.

So lets say i have a grenade and everybody affected becomes for 50 seconds 20% paralysis (he moves slower and shots slower).

Re: paralysis

Posted: Tue Jan 21, 2014 7:14 pm
by Kingpin
Never seen that happen before. Maybe, you (on singleplayer only) use the LUA to somehow make the player work similar to a playercommand in Fake Console. Example, the "slow team blah blah blah" button makes the speeds of the characters slow. Maybe you could make the weapon cause an effect, and make them slow for such a large amount, they are virtually frozen. This is all theoretical, though.

Re: paralysis

Posted: Tue Jan 21, 2014 7:59 pm
by Nedarb7
You could try...

Code: Select all

OnObjectDamage(
 function(object, damager)
 if GetObjectHealth(object) > 900000 then return end
 if GetObjectLastHitWeaponClass(object) == "THEWEAPONNAME" then
 UnitSpeedDec(object, 50)
 end 
end
 )
After ScriptPostLoad section:

Code: Select all

function UnitSpeedDec(object, timercount)
 SetProperty(object, "MaxSpeed", ENTERDISIREDVALUE)
 CreateTimer(untildef)
 SetTimerValue(untildef, timercount)
 StartTimer(untildef)
 OnTimerElapse(
 function(timer)
 SetProperty(object, "MaxSpeed", ENTERDEFAULTVALUE)
 end,
untildef
 )
 DestroyTimer(untildef)
end

I'm basing this of what I see in MasterSaitek009's Force Stasis... I'm not sure if it will work or not

Re: paralysis

Posted: Wed Jan 22, 2014 11:46 am
by Anakin
would this be multi compatible??

Re: paralysis

Posted: Wed Jan 22, 2014 12:15 pm
by THEWULFMAN
Doubtful. Lua weapons rarely are.

Re: paralysis

Posted: Wed Jan 22, 2014 12:27 pm
by Anakin
ok i'll may have a look at this later :)