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

Whats wrong.

ruth

Veteran OT User
Joined
Aug 3, 2009
Messages
670
Solutions
2
Reaction score
380
Hello.
I wanna know whats wrong with that script. My engine can't load:

Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local fire = createConditionObject(CONDITION_FIRE)
addDamageCondition(fire, 4, 6000, -20)
addDamageCondition(fire, 4, 6000, -10)

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()
	talk = math.random(1,40)
	if talk == 1 then
		selfSay("LONG LIVE THE KING!")
	end
end

function creatureSayCallback(cid, type, msg)
	if(npcHandler.focus ~= cid) then
		return FALSE
	end
	if msgcontains(msg, 'job') then
		selfSay("My duty is to protect this town from wild monsters.")
	elseif msgcontains(msg, 'king') then
		selfSay("I would protect the king with my own like if necessary!")
	elseif msgcontains(msg, 'ass') or msgcontains(msg, 'craw') or msgcontains(msg, 'fuck') then
		selfSay("Take this!")
		doCreatureSay(cid, "Ouch!", TALKTYPE_ORANGE_1)
		doTargetCombatCondition(0, cid, fire, CONST_ME_NONE)
	elseif msgcontains(msg, 'heal') and getCreatureHealth(cid) < 65 then
		selfSay("You're hurt, let me heal you.")
		heal = 65 - getCreatureHealth(cid)
		doCreatureAddHealth(cid, heal)
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
	elseif msgcontains(msg, 'heal') and getCreatureHealth(cid) >= 65 then
		selfSay("You don't need to be healed.")
	end
		
	end
	return TRUE
end


keywordHandler:addKeyword({'queen'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Queen Eloise is our beloved sovereign!'})

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Code:
Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/guard.lua
data/npc/scripts/guard.lua:44: '<eof>' expected near 'end'
 
Healing is working but now when i say fuck, ass ect. i gets a debug. When i login again myself is burning.
 
What server?
try changing:
Code:
doCreatureSay(cid, "Ouch!", [B][COLOR="red"]TALKTYPE_ORANGE_1[/COLOR][/B])
to 17 or 19
 
Replace:
Code:
doTargetCombatCondition(0, cid, fire, CONST_ME_NONE)
with:
Code:
doAddCondition(cid, fire)
 
Back
Top