1function onSay(player, words, param)
2 if player:getGroup():getId() < 3 then
3 return false
4 end
5
6 local position = player:getPosition()
7 local isGhost = not player:isInGhostMode()
8
9 player:setGhostMode(isGhost)
10 if isGhost then
11 player:sendTextMessage(MESSAGE_INFO_DESCR, "You are now invisible.")
12 position:sendMagicEffect(CONST_ME_YALAHARIGHOST)
13 else
14 player:sendTextMessage(MESSAGE_INFO_DESCR, "You are visible again.")
15 position.x = position.x + 1
16 position:sendMagicEffect(CONST_ME_SMOKE)
17 end
18 return false
19end
20