[DiscordArchive] maybe any have large repo of all possibles lua eluna?
[DiscordArchive] maybe any have large repo of all possibles lua eluna?
Archived author: SheoWorld • Posted: 2019-06-04T12:22:48.587000+00:00
Original source
maybe any have large repo of all possibles lua eluna?
Archived author: Shard • Posted: 2019-06-04T12:30:52.531000+00:00
Original source
<@527160687680552961>
```lua
local NpcId = 2843
local MyNPC = {}
function MyNPC.Move(event, delay, pCall, creature)
creature:MoveTo(2, 2024.25, 6844.25, 171.42);
end
function MyNPC.MoveBack(event, delay, pCall, creature)
creature:MoveTo(3, 2018.91, 6854.47, 171.42);
end
function MyNPC.OnSpawn(event, creature) -- 5
creature:RegisterEvent(MyNPC.Move, 100, 1);
end
function MyNPC.OnWP(event, creature, type, id) -- 6
if(id == 2) then
creature:RegisterEvent(MyNPC.MoveBack, 100, 1);
else if (id == 3) then
creature:RegisterEvent(MyNPC.Move, 100, 1);
end
end
RegisterCreatureEvent(NpcId, 5, MyNPC.OnSpawn)
RegisterCreatureEvent(NpcId, 6, MyNPC.OnWP)
```
I would do something like this. I haven't tried it, but u can
Archived author: SheoWorld • Posted: 2019-06-04T12:34:00.747000+00:00
Original source
Dude, you are best. Exactly what i am looking for. There is MyNPC.OnWP(event, creature, type, id) - id is wp id?
Archived author: Shard • Posted: 2019-06-04T12:34:11.371000+00:00
Original source
Yep
Archived author: Shard • Posted: 2019-06-04T12:34:28.493000+00:00
Original source
<@527160687680552961>
http://www.elunaengine.com/Unit/MoveTo.html
http://www.elunaengine.com/Global/Regist...Event.html
[Embed: Unit:MoveTo - Eluna]
API documentation for the Unit:MoveTo method in the Eluna engine.
http://www.elunaengine.com/Unit/MoveTo.html
[Embed: Global:RegisterCreatureEvent - Eluna]
API documentation for the Global:RegisterCreatureEvent method in the Eluna engine.
http://www.elunaengine.com/Global/Regist...Event.html
Archived author: SheoWorld • Posted: 2019-06-04T12:36:12.551000+00:00
Original source
Thanks, ill read all over it. And many is good for understood. But lua is very new for me, and eluna script references is not compiling in my head)
Archived author: Shard • Posted: 2019-06-04T12:39:07.570000+00:00
Original source
Don't worry, it's pretty easy to understand :p
Archived author: SheoWorld • Posted: 2019-06-04T12:52:12.250000+00:00
Original source
<@273112219573551114> , sorry. just didn't see where is problem - 2019-06-04 14:54:15 ERROR: lua_scripts/test3.lua:26: 'end' expected (to close 'function' at line 16) near <eof>
Archived author: SheoWorld • Posted: 2019-06-04T12:59:59.612000+00:00
Original source
ok, add a "end" , and it's run. thanx