• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Summon with switch

GMNino

New Member
Joined
Jun 30, 2007
Messages
119
Reaction score
3
Code:
local Summons =
	{
		[1495] = {"Undead Dragon", {x=1404, y=1331, z=7}},
		[1496] = {"Dragon Lord", {x=1566, y=1481, z=7}},
		[1497] = {"Wyrm", {x=1457, y=1411, z=6}},
		[1498] = {"Vampire", {x=1480, y=1572, z=7}},
		[1499] = {"Bog raider", {x=1510, y=1594, z=7}},
		[1500] = {"Infernalist", {x=1524, y=1401, z=7}},
		[1501] = {"Frost dragon", {x=1563, y=1376, z=7}},
		[1502] = {"Earth Elemental", {x=1533, y=1558, z=7}},
		[1503] = {"Hero", {x=1596, y=1546, z=7}},
		[1504] = {"Nightmare", {x=1540, y=1526, z=7}},
		[1505] = {"Warlock", {x=288, y=927, z=11}},
		[1506] = {"Demon", {x=1355, y=1573, z=7}},
		[1507] = {"Serpent Spawn", {x=1564, y=1580, z=7}},
		[1508] = {"Grim Reaper", {x=453, y=839, z=7}},
		[1509] = {"Giant Spider", {x=1404, y=1409, z=7}},
		[1510] = {"Black Knight", {x=1595, y=1546, z=7}},
		[1511] = {"Behemoth", {x=1471, y=1618, z=7}},
		[1512] = {"Hydra", {x=1461, y=1491, z=7}},
		[1513] = {"Vampire Bride", {x=1502, y=1417, z=7}},
		[1514] = {"Frost Dragon Hatchling",  {x=1591, y=1396, z=7}},
		[1515] = {"Earth Overlord",  {x=1509, y=1557, z=7}},
		[1516] = {"Blightwalker",  {x=1629, y=1465, z=7}},
		[1517] = {"Grim Reaper",  {x=1568, y=1420, z=6}},
		[1518] = {"Juggernaut",  {x=1411, y=1561, z=7}},
		[1519] = {"Massive Energy Elemental",  {x=1466, y=1558, z=7}},
		[1520] = {"Infernatil",  {x=1558, y=1445, z=7}},
		[1521] = {"Demon",  {x=1354, y=1639, z=7}},
		[1522] = {"Hellfire Fighter",  {x=1313, y=1628, z=7}},
		[1523] = {"Apocalypse",  {x=1376, y=1669, z=7}},
		[1524] = {"Plaguesmith",  {x=1413, y=1653, z=7}},
		[1525] = {"Juggernaut",  {x=1431, y=1622, z=7}},
		[1526] = {"Hellfire Fighter",  {x=1390, y=1608, z=7}},
	}
	
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local Summon = Summons[item.uid]
	if Summon then
		if (os.time() - getGlobalStorageValue(item.uid + 2000)) > delay then
			doSummonCreature(Summon[1], Summon[2])
			setGlobalStorageValue(item.uid + 2000, os.time())
		else
			doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "You must wait " .. delay .. " seconds!")
		end
	end
	return TRUE
end

need help with this script i use tfs cryson, error in console:

Code:
[27/02/2009 16:10:05] Lua Script Error: [Action Interface] 
[27/02/2009 16:10:05] data/actions/scripts/tales 13.lua:onUse

[27/02/2009 16:10:05] data/actions/scripts/tales 13.lua:40: attempt to compare nil with number
[27/02/2009 16:10:05] stack traceback:
[27/02/2009 16:10:05] 	data/actions/scripts/tales 13.lua:40: in function <data/actions/scripts/tales 13.lua:37>
 
Back
Top