First commit
This commit is contained in:
		
							
								
								
									
										22
									
								
								app/SabrehavenServer/data/talkactions/scripts/ghost.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								app/SabrehavenServer/data/talkactions/scripts/ghost.lua
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
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:sendMagicEffect(CONST_ME_TELEPORT)
 | 
			
		||||
	end
 | 
			
		||||
	return false
 | 
			
		||||
end
 | 
			
		||||
		Reference in New Issue
	
	Block a user