05-07-2013, 02:39 AM
05-07-2013, 02:41 AM
Yes. A number that uniquely identifies the mob throughout its life. It's used for networking and it's also used if you need to "remember" an entity between different callbacks in the plugin (you cannot store the entity object!)
05-07-2013, 04:51 AM
What's wrong with this?
function HandleCheckCommand( Player )
	local EachEntity = function( Entity )
		if Entity:IsMob() == true then
		       Mobs = Mobs + 1
              end
       end
       local loopPlayer = function ( Player )
              Player:SendMessage( "Killed " .. Mobs .. " mobs." )
              return true
       end
end
It gives me Unknown command05-07-2013, 05:03 AM
do "return true" before the last end
05-07-2013, 05:44 AM
Currently your code does nothing. You declare two local functions, but never use them.
Also, don't compare boolean vars to constants, use them directly.
And last but not least, the code won't do what you want - supposing you fix everything, the first function will count all the *living* mobs.
Also, don't compare boolean vars to constants, use them directly.
And last but not least, the code won't do what you want - supposing you fix everything, the first function will count all the *living* mobs.
function HandleCheckCommand(Player)
    local CountIfMob = function(Entity)
        if Entity:IsMob() then
              Mobs = Mobs + 1;
        end
    end
    Player:GetWorld():ForEachEntity(CountIfMob);
 
    Player:SendMessage("There are currently " .. Mobs .. " mobs." );
    return true;
end
05-07-2013, 06:36 AM
(05-07-2013, 05:44 AM)xoft Wrote: [ -> ]the code won't do what you want - supposing you fix everything, the first function will count all the *living* mobs.I know it, to kill all mobs is Entity:Destroy()
05-08-2013, 05:26 AM
It gives me an error with GetWorld
05-08-2013, 05:31 AM
It's broken

05-08-2013, 05:34 AM
(05-08-2013, 05:31 AM)xoft Wrote: [ -> ]It's brokenGetWorld?
With other plugins work
05-08-2013, 06:13 AM
What else can I tell you? You didn't say what the error was, you didn't post your code, nothing. So there's really nothing else I can say.