Gaddhuve
Member
- Joined
- May 6, 2011
- Messages
- 76
- Solutions
- 1
- Reaction score
- 19
So Im not really sure what the best way to do this. Could someone point me in the right direction? This is my attempt:
I just dont know how to use creature:getName() and if I should even use it for this. Thanks in advance
Code:
local function myFunction(creature, pos)
local targetNpc = creature('NPC'):getName()
if targetNpc ~= nil then
addEvent(
function (npcID)
local npc = Npc(npcID)
if npc ~= nil then
npc:say('Hello', TALKTYPE_SAY)
end
end
, 3000, targetNpc:getId())
end
end
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return false
end
if player:getStorageValue(6000) == -1 then
addEvent(myFunction, 1000)
end
return true
end
I just dont know how to use creature:getName() and if I should even use it for this. Thanks in advance