• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua I wounder if someone can help me with this quest

NilssoN042

Banned User
Joined
Sep 8, 2008
Messages
998
Reaction score
2
Location
Sweden, Helsingborg
I have got a problem with this script! Its yalahari quest!

I use TFS 0.3.5

PHP:
function onStepIn(cid, item, position, fromPosition)

--Config-->
local queststatus = getPlayerStorageValue(cid, 50001)
--EndConfig-->
	if item.actionid == 1974 and queststatus == -1 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "It seems by defeating Azerus you have stoped this army from entering your world! Better leave this ghastly place forever.")
		setPlayerStorageValue(cid, 4765, 1)
	return TRUE
end

if item.actionid == 1973 and queststatus == -1 then
-- Here is the code start:
starting={x = 573, y = 555, z = 10, stackpos = 253}
checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos}
ending={x = 590, y = 577, z = 10, stackpos = 253}
players=0
totalmonsters=0
monster = {}
repeat
creature= getThingfromPos(checking)
 if creature.itemid > 0 then
 if getPlayerAccess(creature.uid) == 0 then
 players=players+1
 end
  if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
 totalmonsters=totalmonsters+1
  monster[totalmonsters]=creature.uid
   end
 end
checking.x=checking.x+1
  if checking.x>ending.x then
  checking.x=starting.x
  checking.y=checking.y+1
 end
until checking.y>ending.y
if players==0 then
trash= {x=33193, y=31689, z=15}
current=0
repeat
current=current+1
doTeleportThing(monster[current],trash)
until current>=totalmonsters
end
-- Here is the end of it

doTeleportThing(cid, player_pos_entrada)
doSendMagicEffect(player_pos_entrada, 10)

else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have made the quest!')
end
end


I get errors on line 47
 
I have edited the 1 line now!

Before:
function onStepIn(cid, item, position, fromPosition)
Now:
function onStepIn(cid, item, position, fromPosition, player_pos_entrada)


Do you think that it was the problem?
 
Code:
 function onStepIn(cid, item, position, fromPosition)

--Config-->
local queststatus = getPlayerStorageValue(cid, 50001)
--EndConfig-->
    if item.actionid == 1974 and queststatus == -1 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "It seems by defeating Azerus you have stoped this army from entering your world! Better leave this ghastly place forever.")
        setPlayerStorageValue(cid, 4765, 1)
    return TRUE
end

if item.actionid == 1973 and queststatus == -1 then
-- Here is the code start:
starting={x = 573, y = 555, z = 10, stackpos = 253}
checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos}
ending={x = 590, y = 577, z = 10, stackpos = 253}
players=0
totalmonsters=0
monster = {}
repeat
creature= getThingfromPos(checking)
 if creature.itemid > 0 then
 if getPlayerAccess(creature.uid) == 0 then
 players=players+1
 end
  if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
 totalmonsters=totalmonsters+1
  monster[totalmonsters]=creature.uid
   end
 end
checking.x=checking.x+1
  if checking.x>ending.x then
  checking.x=starting.x
  checking.y=checking.y+1
 end
until checking.y>ending.y
if players==0 then
trash= {x=33193, y=31689, z=15}
current=0
repeat
current=current+1
doTeleportThing(monster[current],trash)
until current>=totalmonsters
end
-- Here is the end of it

doTeleportThing(cid, position)
doSendMagicEffect(cid, 10)

else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have made the quest!')
end
end

Not sure, just trying.. Otherwise this one.

Code:
 function onStepIn(cid, item, position, fromPosition)

--Config-->
local queststatus = getPlayerStorageValue(cid, 50001)
--EndConfig-->
    if item.actionid == 1974 and queststatus == -1 then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "It seems by defeating Azerus you have stoped this army from entering your world! Better leave this ghastly place forever.")
        setPlayerStorageValue(cid, 4765, 1)
    return TRUE
end

if item.actionid == 1973 and queststatus == -1 then
-- Here is the code start:
starting={x = 573, y = 555, z = 10, stackpos = 253}
checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos}
ending={x = 590, y = 577, z = 10, stackpos = 253}
players=0
totalmonsters=0
monster = {}
repeat
creature= getThingfromPos(checking)
 if creature.itemid > 0 then
 if getPlayerAccess(creature.uid) == 0 then
 players=players+1
 end
  if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 then
 totalmonsters=totalmonsters+1
  monster[totalmonsters]=creature.uid
   end
 end
checking.x=checking.x+1
  if checking.x>ending.x then
  checking.x=starting.x
  checking.y=checking.y+1
 end
until checking.y>ending.y
if players==0 then
trash= {x=33193, y=31689, z=15}
current=0
repeat
current=current+1
doTeleportThing(monster[current],trash)
until current>=totalmonsters
end
-- Here is the end of it

doTeleportThing(cid, fromPosition)
doSendMagicEffect(cid, 10)

else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'You have made the quest!')
end
end
 
Back
Top