• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua /ghost in lua

Xagul

deathzot.net
Joined
Jun 30, 2008
Messages
1,295
Solutions
3
Reaction score
1,043
Hello, I am currently trying to get /ghost to work in lua and so far I'm having no luck. Right now I am trying to use this:

Code:
local condition = createConditionObject(GAMEMASTER_INVISIBLE)

but it seems GAMEMASTER_INVISIBLE is not a condition =\... If there is a way to edit the source and make GAMEMASTER_INVISIBLE a real condition I would love some help with that otherwise if there is an alternative way I am also happy with that.
 
I am using 0.4 however if you are willing to share the 0.3 so I can see how it was done maybe i can make a 0.4 version
 
well in my talkactions.xml i have
PHP:
	<talkaction log="yes" words="/ghost" access="3" event="function" value="ghost"/>
i have no lua script for it :P soo idk how your server commands are set out but all mine are in talkactions

And in data/lib/functions i have
PHP:
function isPlayerGhost(cid)
	if(not isPlayer(cid)) then
		return false
	end

	return getCreatureCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE) or getPlayerFlagValue(cid, PLAYERFLAG_CANNOTBESEEN)
 
Yes but you see you are using:

Code:
event="function" value="ghost"

I want to use:

Code:
event="script" value="ghost.lua"

So I can modify the ghost command and maybe use the ghost condition in another script.
 
the real condition is CONDITION_GAMEMASTER, but this wouldn't work

it doesn't work with normal players by default even if you use doCreatureExecuteTalkAction(cid, '/ghost', true), it doesn't exec sendCreatureChangeVisible properly
 
Back
Top