How To Test For A Non-player

Main.HowToTestForANon-player History

Hide minor edits - Show changes to markup

December 30, 2008, at 05:17 PM EST by admin
Changed lines 3-6 from:

if not(isplayer(ch)) then

   say("I don't deal with mobs, shoo!")

end

to:
     if not(isplayer(ch)) then
        say("I don't deal with mobs, shoo!")
     end
December 30, 2008, at 05:17 PM EST by admin
Changed lines 3-6 from:

if not(isplayer(ch)) then say("I don't deal with mobs, shoo!") end

to:

if not(isplayer(ch)) then

   say("I don't deal with mobs, shoo!")

end

December 30, 2008, at 05:16 PM EST by admin
Added lines 1-6:

The 'isplayer(CH)' function tests if a character variable is a player. The old mobprog system had no concept of not. In Lua, you would just wrap a 'not' around it:

if not(isplayer(ch)) then say("I don't deal with mobs, shoo!") end