2019-01-16 17:16:38 -05:00

24 lines
600 B
Lua

function onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
if player:getAccountType() < ACCOUNT_TYPE_GAMEMASTER then
return false
end
local position = player:getPosition()
local isGhost = not player:isInGhostMode()
player:setGhostMode(isGhost)
if isGhost then
player:sendTextMessage(MESSAGE_INFO_DESCR, "You are now invisible.")
position:sendMagicEffect(CONST_ME_POFF)
else
player:sendTextMessage(MESSAGE_INFO_DESCR, "You are visible again.")
position.x = position.x + 1
position:sendMagicEffect(CONST_ME_TELEPORT)
end
return false
end