zajacmp3
New Member
Hello!
I want to introduce you a part of my test NPC script. On what I am testing some functions. I noticed that doTeleportThing does not work. I think the issue is in how I am writing position. Any ideas what I am doing wrong?
I want to introduce you a part of my test NPC script. On what I am testing some functions. I noticed that doTeleportThing does not work. I think the issue is in how I am writing position. Any ideas what I am doing wrong?
PHP:
function onCreatureSay(cid, type, msg)
local pos = {x=1050, y=1048, z=6, stackpos=1}
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 and getPlayerStorageValue(cid, 66666) == 5 then
selfSay('Eureka.')
doTeleportThing(cid, pos)
focus = 0
elseif (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
selfSay('Jestes wtrakcie walki.')
focus = 0
elseif (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 and (getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE) then
selfSay('Nie walczysz')
focus = 0
setPlayerStorageValue(cid, 66666, 5)
end
end