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

help.

god nacke

New Member
Joined
Sep 7, 2008
Messages
46
Reaction score
0
Hello,give one error npc,what the problem is using TFS 0.3.2 crimson

PHP:
[07/04/2009 19:50:50] [Warning - NpcScript::NpcScript] Can not load script: data/npc/scripts/guard.lua
[07/04/2009 19:50:50] data/npc/scripts/guard.lua:44: '<eof>' expected near 'end'

PHP:
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 life to 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
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


thz for all
 
PHP:
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 life to 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
        
    return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top