• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Npc - chat window

try to make it onLook and set it just for NPC, probably that will work better, because if you set NPC attackable then you will kill him and also it will set a battle icon, also players might just 'bomb' the NPC just for fun, so onLook can be the best bet, just hold shift+LMB.

NPC is immune to every damage, also it returns false, thus, disabling the attack. kthx
 
dunno, but in NPC_NAME.xml set attackable="1" and add this to your creaturescripts:
Code:
function onAttack(cid, target)
    if(isNpc(target))then return doCreatureSay(cid, "Hi!", TALKTYPE_SAY) and false end
end
ops fail nob,
it will return false each anything than an npc atks each others when do someone try do kill do someone then the someone that are atk he wont do atk he... nob ffs
 
creaturesripts.xml:
<event type="attack" name="NpcAttack" event="script" value="npc attack.lua"/>

scripts/login.lua
registerCreatureEvent(cid, "NpcAttack")


whenever I try to put that on login.lua, i get an error:
>> Loading script systems
[Error - CreatureEvent::configureEvent] Invalid type for creature event: NpcAtta
ck
[Warning - BaseEvents::loadFromXml] Failed to configure event
 
whenever I try to put that on login.lua, i get an error:
>> Loading script systems
[Error - CreatureEvent::configureEvent] Invalid type for creature event: NpcAtta
ck
[Warning - BaseEvents::loadFromXml] Failed to configure event


SCRATCH THAT!
I looked at the list of TFS 1.0 creaturescript types and noticed ATTACK was not one of them, so i changed it to preparekill, which i assume is similar to ATTACK

it doesn't give me that error anymore, how ever when i put this line on login.lua, I cannot loging because of some error:
player:registerCreatureEvent(cid, "NpcAttack")
(REMOVING "PLAYER:" LETS ME LOGIN, BUT DOESN'T DO ANYTHING WHEN I RIGHT CLICK THE NPC)

Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/login.lua:onLogin
data/creaturescripts/scripts/login.lua:35: attempt to call method 'registerCreat
ureEvent' (a nil value)
stack traceback:
        [C]: in function 'registerCreatureEvent'
        data/creaturescripts/scripts/login.lua:35: in function <data/creaturescr
ipts/scripts/login.lua:1>
 
And why not make the NPC with different name and react to certain Greet Message, something like this:
You need to add this lines on the end of NPC1_NAME.xml
Code:
local focusModule = FocusModule:new()
focusModule:addGreetMessage('hi farmer one')
focusModule:addGreetMessage('hi farmero')
npcHandler:addModule(focusModule)

And add this lines on the end of NPC2_NAME2.xml
Code:
local focusModule = FocusModule:new()
focusModule:addGreetMessage('hi farmer two')
focusModule:addGreetMessage('hi farmera')
npcHandler:addModule(focusModule)

And they just react if you say the specific greet message. Like King Tibianus on Real Tibia or like the npc on kazordoon in tibia Bezil and Nezil, if you dont say: Hi Bezil. He don't answer and for the other you need to say Hi Nezil, if you don't say their names on hi they just say: are you talk to me?... I hope this things can help you, Regards.
 
Last edited:
Back
Top