Page 1 of 1

Weakness trigger GM Command

Posted: Sun Nov 15, 2015 5:29 pm
by babblebab
I am trying to make a command to trigger the weakness packet. I had it working awhile back but forgot how I set it up.
Using the commands I found in mobutils.cpp and lua_baseentity.cpp I tried to setup a simple yellow trigger script like so:

Code: Select all

cmdprops =
{
    permission = 1,
    parameters = "s"
};

function onTrigger(player, WeaknessType)
	local targ = player:getTargetID();
	if (targ ~= nil) then
		targ:WeaknessTrigger( yellow );
	else
        player:PrintToPlayer("You must select a valid target first.");
    end
end;
but I cannot seem to get it working, does anybody see what I'm doing wrong?

Re: Weakness trigger GM Command

Posted: Sun Nov 15, 2015 6:16 pm
by kjLotus
weakness type has to be a number

Re: Weakness trigger GM Command

Posted: Sun Nov 15, 2015 7:37 pm
by babblebab
Probably should have guessed that.
Got it working, thanks kj