- Joined
- Nov 17, 2010
- Messages
- 6,788
- Solutions
- 581
- Reaction score
- 5,354
Posted originally here, but I don't see how it works?
Specifically this portion.
I've always used position data like this;
I just can't wrap my head around how looping through
Can someone explain how this works?
full script.
Specifically this portion.
Lua:
for i = 17000, 18015 do
local pos = getThingPos(i)
if not isPlayer(getTopCreature(pos).uid) then
I've always used position data like this;
{x = 1000, y = 1000, z = 7[, stackpos = 1]}
I just can't wrap my head around how looping through
i
allows the script to create a position?Can someone explain how this works?
full script.
Lua:
function onStepIn(cid, item, position, fromPosition)
for i = 17000, 18015 do
local pos = getThingPos(i)
if not isPlayer(getTopCreature(pos).uid) then
doTeleportThing(cid, pos)
doCreatureSay(cid, 'Training time!.', TALKTYPE_ORANGE_1, false, cid)
doSendMagicEffect(position, CONST_ME_TELEPORT)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
return true
end
end
doTeleportThing(cid, fromPosition, true)
doCreatureSay(cid, 'All training slots are taken', TALKTYPE_ORANGE_1, false, cid)
doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
end