Weakness trigger GM Command

Post Reply
babblebab
Posts: 40
Joined: Sat Dec 01, 2012 9:50 pm

Weakness trigger GM Command

Post by babblebab » Sun Nov 15, 2015 5:29 pm

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?

User avatar
kjLotus
Lead Developer
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Weakness trigger GM Command

Post by kjLotus » Sun Nov 15, 2015 6:16 pm

weakness type has to be a number

babblebab
Posts: 40
Joined: Sat Dec 01, 2012 9:50 pm

Re: Weakness trigger GM Command

Post by babblebab » Sun Nov 15, 2015 7:37 pm

Probably should have guessed that.
Got it working, thanks kj

Post Reply