Hello, I found some useful npc from older servers, I would like to fire them on tfs 1.3 10.98 exactly but the system probably changed because the server can not see if someone can direct me how to change the script below to fire on tfs?
scripts lua np
Code:
<?xml version="1.0"?>
<npc name="Bakorek" script="data/npc/scripts/sl.lua" access="3">
<look type="129" head="114" body="119" legs="114" feet="114"/>
</npc>
scripts lua np
Code:
focus = 0
talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Dowidzenia.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not
string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if ((string.find(msg, '(%a*)hi(%a*)')
or string.find(msg, '(%a*)siema(%a*)')
or string.find(msg, '(%a*)czesc(%a*)')
or string.find(msg, '(%a*)cze(%a*)')
or string.find(msg, '(%a*)yo(%a*)')
or string.find(msg, '(%a*)elo(%a*)'))
and (focus == 0)) and getDistanceToCreature(cid) < 4 then
rsay = math.random(1,4)
if rsay == 1 then says = 'Waazzuup'
elseif rsay == 2 then says = 'Siema'
elseif rsay == 3 then says = 'Czesc'
elseif rsay == 4 then says = 'Witam'
end
if isPremium(cid) then
selfSay('Siemka ' .. creatureGetName(cid) .. '! Czy chcesz kupic wypasiony amulet?( star light) za 500 cc?')
focus = cid
talk_start = os.clock()
else
selfSay('Ten amulet moga miec osoby tylko z Pacc !')
focus = 0
talk_start = 0
end
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Spadaj do kolejki ' .. creatureGetName(cid) .. ' .')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'nie') then
selfSay('Gdy nosisz ten amulet to nie spada eq ani skile (dziala tylko dla pacc) kosztuje 500 cc.')
elseif msgcontains(msg, 'starlight') then
buy(cid,2138,1,5000000)
elseif msgcontains(msg, 'sl') then
buy(cid,2138,1,5000000)
elseif msgcontains(msg, 'tak') then
buy(cid,2138,1,5000000)
elseif msgcontains(msg, 'yes') then
buy(cid,2138,1,5000000)
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Dowidzenia ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Nastepny prosze.')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Dowiedzenia.')
focus = 0
end
end
end