mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-16 07:14:55 +02:00
Full Distribution
This commit is contained in:
23
data/talkactions/scripts/ghost.lua
Normal file
23
data/talkactions/scripts/ghost.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
Reference in New Issue
Block a user