kite28
Member
- Joined
- May 15, 2012
- Messages
- 69
- Reaction score
- 5
I do not have the / m option on the server, i.e. create a monster here, you have Creature.lua, talkaction script and whatever else you need it to scream.
Talkaction.xml
Creature.lua
Talkaction.xml
Code:
<talkaction log="yes" words="/m" access="6" event="script" value="creature.lua"/>
Creature.lua
Code:
function onSay(cid, words, param, channel)
local func = doCreateMonster
if(words:sub(2, 2) == "n") then
func = doCreateNpc
end
local pid = cid
local t = string.explode(param, ",")
local position = getCreaturePosition(pid)
local effect = CONST_ME_MAGIC_RED
local ret = func(t[1], position, false)
if(tonumber(ret) == nil) then
effect = CONST_ME_POFF
doPlayerSendDefaultCancel(cid, (ret == false and RETURNVALUE_NOTPOSSIBLE or RETURNVALUE_NOTENOUGHROOM))
end
doSendMagicEffect(position, effect)
return true
end