ond
Veteran OT User
I wonder if someone could help me with my guard script? If you say fuck, the guard should remove all your hitpoints (hp) except one!
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
origmsg = msg
msg = string.lower(msg)
if msgcontains(msg, 'fuck') then
local fucked = FALSE
if getCreatureHealth(cid) > 66 then
doCreatureAddHealth(cid,-65-getCreatureHealth(cid))
doSendMagicEffect(getPlayerPosition(cid),CONST_ME_MAGIC_BLUE)
fucked = TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())