Joe Rod
Discord: joerod1
Hi guys, with this you would greet the npc and open its shop (if has)
It works on directly look and look on battlelist
This is really simple, but someone could find it useful
data/events/scripts/player.lua
at the beginning of file paste this
find
paste this below that:
find
paste this below that:
tested on OTX, it will work on TFS 1.x i guess
It works on directly look and look on battlelist
This is really simple, but someone could find it useful
data/events/scripts/player.lua
at the beginning of file paste this
Code:
local minDist = 5 --this will be the min distance required to interact
find
Code:
function Player:onLook(thing, position, distance)
paste this below that:
Code:
if (thing:isCreature() and thing:isNpc() and distance <= minDist) then
self:say("hi", TALKTYPE_PRIVATE_PN, false, thing)
self:say("trade", TALKTYPE_PRIVATE_PN, false, thing)
return false
end
find
Code:
function Player:onLookInBattleList(creature, distance)
paste this below that:
Code:
if (creature:isNpc() and distance <= minDist) then
self:say("hi", TALKTYPE_PRIVATE_PN, false, creature)
self:say("trade", TALKTYPE_PRIVATE_PN, false, creature)
return false
end
tested on OTX, it will work on TFS 1.x i guess