+Rep Nice.
:O I already posted in this guide woops![]()
+Rep Nice.
:O I already posted in this guide woops![]()
Last edited by Confucius; 07-21-2009 at 10:54 PM.
VERY nice, I read most of it and I'll finish it later, this may motivate me to make my server again. +Repx3 goes without saying.
I've one question: Unit:RegisterEvent("Creature_CastSpell", 1000, 0(1))
What's 0 or 1, in the end. What's that for? I can't get it, help to noob please
Btw nice guide, +rep
Edit: And one more, what's the difference between Unit and pUnit?
Last edited by Haldir; 08-04-2009 at 03:49 AM.
does this tutorial really work? im sick of these fly by nights
The 0/1 stands for how many times "Creature_CastSpell" will get called on.
If you put in 0, it will call "Creature_CastSpell" And execute any code within "Creature_CastSpell"s function every second, until stopped with the command (Unit:RemoveEvents()). If you put in a 1, it means it will only be called upon once, executing the code within "Creature_CastSpell" just once. If you change it to a 2, it will call upon the function twice. And so on.
Great repack!
Thanks vision!!!! +Rep x2urewin:
Thank you!
Amazing detailed guide +Rep
Eh, need help again..
I want to spawn 3 npcs and then make them move to X Y Z coords, each npc will have its own coords. Can someone tell me how to do it? I know how to spawn, but don't know how to make them move not together.
I've no idea how to do it, please help somebody. If i'll do it like this, will it work or not?
function Spawn(Unit1,Unit2,Unit3, Event)
Unit1:SpawnCreature(NPCID,X,Y,Z,O,FactionID,duratation)
Unit2:SpawnCreature(NPCID,X,Y,Z,O,FactionID,duratation)
Unit3:SpawnCreature(NPCID,X,Y,Z,O,FactionID,duratation)
Unit1:MoveTo(X,Y,Z,O)
Unit2:MoveTo(X,Y,Z,O)
Unit3:MoveTo(X,Y,Z,O)
Last edited by Haldir; 08-05-2009 at 07:31 AM.
I think you need to have Another npc that spawns them, you can also have an item. But then youd have to go ingame.
To the place where you want the minions to spawn. And write .gps and then use that info.
Hope this works.local Unit1 = ID -- Put ID's for the units on these 'locals'
local Unit2 = ID
local Unit3 = ID
function despawn(Unit, Event)
pUnit = ID -- This is the ID for the npc that spawns creatures.
x = pUnit:GetX() -- Gets the X where the npc stands.
y = pUnit:GetY() -- Gets the Y where the npc stands.
z = pUnit:GetZ() -- Gets the Z where the npc stands.
o = pUnit:GetO() -- Gets the O where the npc stands.
pUnit:RegisterEvent("Next_Step", 1, 0) -- New event
end
function Next_Step(Unit, Event)
pUnit:SpawnCreature(Unit1, x + 4, y, z, o, Faction, Duration) -- Spawns creature at the same position as the summon npc, only +4 x
pUnit:SpawnCreature(Unit2, x + 7, y, z, o, Faction, Duration) -- Spawns creature at the same position as the summon npc, only +7 x
pUnit:SpawnCreature(Unit3, x + 1, y, z, o, Faction, Duration) -- Spawns creature at the same position as the summon npc, only +1 x
pUnit:despawn() -- Despawns the summon npc.
end
Good guide, mate. Im reading it now. ^^ Ill be repping you later.
Last edited by P1raten; 08-06-2009 at 03:23 AM.
Thx jebus, +rep
Oh, and how to make them move in diff spots?
This script will only make the npc move from its current position.
Change the red. You can change it to like.
pUnit = MoveTo(x + 5, y - 5, z, o)
Code:function Move(Unit, Event) pUnit = ID -- The id of the creature you want to move x = pUnit:GetX() -- Gets the X where the npc stands. y = pUnit:GetY() -- Gets the Y where the npc stands. z = pUnit:GetZ() -- Gets the Z where the npc stands. o = pUnit:GetO() -- Gets the O where the npc stands. pUnit = MoveTo(x, y, z, o) end
This is great, Thanks!
also, +rep !
More and more lua guides popping up but i like this one!
It's massive and colorful.
+rep