• 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!

Guard script, help!

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,782
Solutions
25
Reaction score
491
Location
Sweden
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())
 
Back
Top