• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Need help to fix this script

tyngaste

New Member
Joined
Dec 2, 2008
Messages
223
Reaction score
0
Location
Sweden
')' expected (to close '(' at line 14) near 'doSummonCreature'


function onUse(cid, item, fromPosition, itemEx, toPosition)
local monster = "demon"
local pos1 = {x=32104, y=33267, z=12}
local pos2 = {x=32107, y=33272, z=12}
local pos3 = {x=32102, y=33275, z=12}
local pos4 = {x=32108, y=33276, z=12}
local pos5 = {x=32104, y=33286, z=12}
local pos6 = {x=32106, y=33286, z=12}
local id = 1419

if item.itemid == id and item.uid == 50000 then
if isPlayer(cid) == TRUE then
if queststatus == (getPlayerStorageValue(cid, 55000)
doSummonCreature(monster, pos1)
doSummonCreature(monster, pos2)
doSummonCreature(monster, pos3)
doSummonCreature(monster, pos4)
doSummonCreature(monster, pos5)
doSummonCreature(monster, pos6)
setPlayerStorageValue(cid, 55000) -1
else
if getPlayerStorageValue(cid, 55000) == -1 then
doCreatureSay(cid, "You cannot open it more.", TALKTYPE_ORANGE_1)
end
return 1
end
end

If someone knew how to fix this i would be very thankfull.

thanks in advance
 
i think thers an error in this part

if item.itemid == id and item.uid == 50000 then
if isPlayer(cid) == TRUE then
if queststatus == (getPlayerStorageValue(cid, 55000)

i thnk it has to be

if item.itemid == id and item.uid == 50000 and isPlayer(cid) == TRUE and queststatus == (getPlayerStorageValue(cid, 55000) then

im nt sure im nob
 
i think thers an error in this part

if item.itemid == id and item.uid == 50000 then
if isPlayer(cid) == TRUE then
if queststatus == (getPlayerStorageValue(cid, 55000)

i thnk it has to be

if item.itemid == id and item.uid == 50000 and isPlayer(cid) == TRUE and queststatus == (getPlayerStorageValue(cid, 55000) then

im nt sure im nob

thanks for post didnt work after i did like you said i got this ')' expected near 'then'
 
can u try this man

function onUse(cid, item, fromPosition, itemEx, toPosition)
local monster = "demon"
local pos1 = {x=32104, y=33267, z=12}
local pos2 = {x=32107, y=33272, z=12}
local pos3 = {x=32102, y=33275, z=12}
local pos4 = {x=32108, y=33276, z=12}
local pos5 = {x=32104, y=33286, z=12}
local pos6 = {x=32106, y=33286, z=12}
local id = 1419

if item.uid == 50000 and getPlayerStorageValue(cid,55000) == 1 then

doSummonCreature(monster, pos1)
doSummonCreature(monster, pos2)
doSummonCreature(monster, pos3)
doSummonCreature(monster, pos4)
doSummonCreature(monster, pos5)
doSummonCreature(monster, pos6)
setPlayerStorageValue(cid,55000,1)
else
doCreatureSay(cid, "You cannot open it more.", TALKTYPE_ORANGE_1)
end
return 1
end
end
 
can u try this man

function onUse(cid, item, fromPosition, itemEx, toPosition)
local monster = "demon"
local pos1 = {x=32104, y=33267, z=12}
local pos2 = {x=32107, y=33272, z=12}
local pos3 = {x=32102, y=33275, z=12}
local pos4 = {x=32108, y=33276, z=12}
local pos5 = {x=32104, y=33286, z=12}
local pos6 = {x=32106, y=33286, z=12}
local id = 1419

if item.uid == 50000 and getPlayerStorageValue(cid,55000) == 1 then

doSummonCreature(monster, pos1)
doSummonCreature(monster, pos2)
doSummonCreature(monster, pos3)
doSummonCreature(monster, pos4)
doSummonCreature(monster, pos5)
doSummonCreature(monster, pos6)
setPlayerStorageValue(cid,55000,1)
else
doCreatureSay(cid, "You cannot open it more.", TALKTYPE_ORANGE_1)
end
return 1
end
end

got this now '<eof>' expected near 'end'
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

	local monster = "demon"
	local id = 1419

local pos = { 
		{x=32104, y=33267, z=12},
		{x=32107, y=33272, z=12},
		{x=32102, y=33275, z=12},
		{x=32108, y=33276, z=12},
		{x=32104, y=33286, z=12},
		{x=32106, y=33286, z=12}
	}
	


if item.itemid == id and item.uid == 50000 then
	if isPlayer(cid) == TRUE then
		if getPlayerStorageValue(cid, 55000) < 1 then
			for i = 1, #pos do
				doSummonCreature(monster, pos[i])
			end		
			setPlayerStorageValue(cid, 55000, 1)
		else
			doCreatureSay(cid, "You cannot open it more times.", TALKTYPE_ORANGE_1)
		end
	end
end
return TRUE
end

i quess it's bugless, but not tested
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

	local monster = "demon"
	local id = 1419

local pos = { 
		{x=32104, y=33267, z=12},
		{x=32107, y=33272, z=12},
		{x=32102, y=33275, z=12},
		{x=32108, y=33276, z=12},
		{x=32104, y=33286, z=12},
		{x=32106, y=33286, z=12}
	}
	


if item.itemid == id and item.uid == 50000 then
	if isPlayer(cid) == TRUE then
		if getPlayerStorageValue(cid, 55000) < 1 then
			for i = 1, #pos do
				doSummonCreature(monster, pos[i])
			end		
			setPlayerStorageValue(cid, 55000, 1)
		else
			doCreatureSay(cid, "You cannot open it more times.", TALKTYPE_ORANGE_1)
		end
	end
end
return TRUE
end

i quess it's bugless, but not tested

thanks it worked ^^ btw i got this also

[19/02/2009 22:48:54] [Warning - Monsters::loadMonster] targetdistance greater than maxViewportX. data/monster/birds/seagull.xml

[19/02/2009 22:48:54] [Warning - Monsters::loadMonster] targetdistance greater than maxViewportX. data/monster/frogs/green frog.xml

when starting server you know what prob is?

and also get runtime error after all loaded it stays saving server then i get error and server shutdown anyone know what it could be?
 
Back
Top