• 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!

[ERROR] In Script

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
On my script is error help
photo:

imagemkc.png


script:

Code:
local script =~ arenakill.lua
return TRUE
end
LUA:
function onKill(cid, target)
	local room = getArenaMonsterIdByName(getCreatureName(target))
	if room > 0 then
		setPlayerStorageValue(cid, room, 1)
		doPlayerSendTextMessage(cid,22,"You can enter next room!")
	end
	return TRUE
end


Code:
local script =~ vip1.lua
return TRUE
end

LUA:
function onSay(cid, words, param, channel)
        local shop = {
                ["50cc"] = {
                        id = 2160, count = 50, points = 30
                },
                ["100cc"] = {
                        id = 2160, count = 100, points = 50
                },
                ["sacredS"] = {
                        id = 7409, count = 1, points = 120
                },
                ["sacredS"] = {
                        id = 2408, count = 1, points = 120
                },
                ["sacredA"] = {
                        id = 8925, count = 1, points = 120
                },
                ["kaiserA"] = {
                        id = 2503, count = 1, points = 135
                },
                ["kaiserL"] = {
                        id = 2504, count = 1, points = 135
                },
                ["magicianR"] = {
                        id = 7897, count = 1, points = 135
                },
                ["magicianL"] = {
                        id = 7896, count = 1, points = 135
                },
                ["sacred"] = {
                        id = 2646, count = 1, points = 150
				 },
                ["addon"] = {
                        id = 9693, count = 1, points = 100
				},
                ["soft"] = {
                        id = 6132, count = 1, points = 100
				},
                ["light-bow"] = {
                        id = 8858, count = 1, points = 80
				},
                ["light-arrow"] = {
                        id = 2352, count = 1, points = 80
				},
                ["vip"] = {
                        id = 5785, count = 1, points = 110
                }
        }
        local v = shop[param]
        local check = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = '" .. getPlayerAccountId(cid) .. "' LIMIT 1;")
        if check >= v.points then
                local item = doCreateItemEx(v.id, v.count)
                if doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR then
                        doPlayerSendCancel(cid, "Desculpa,você não tem cap.")
                else
                        doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Shop: Added " .. v.count .."x " .. getItemInfo(v.id).name .. " to your inventory.")
                        db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` - " .. v.points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
                end
        else
                doPlayerSendCancel(cid, "Desculpa,você não tem premium points,compre seus points no shop.")
        end
        return true
end
 
1. create arena.lua in data/lib and put this in it:
Code:
-- arena script
InitArenaScript = 0
arena_room_max_time = 240 -- time in seconds for one arena room
arenaKickPosition = {x=918, y=1240, z=6} -- position where kick from arena when you leave/you did arena level
arena_monsters = {}
arena_monsters[42300] = 'frostfur' -- first monster from 1 arena
arena_monsters[42301] = 'bloodpaw'
arena_monsters[42302] = 'bovinus'
arena_monsters[42303] = 'achad'
arena_monsters[42304] = 'colerian the barbarian'
arena_monsters[42305] = 'the hairy one'
arena_monsters[42306] = 'axeitus headbanger'
arena_monsters[42307] = 'rocky'
arena_monsters[42308] = 'cursed gladiator'
arena_monsters[42309] = 'orcus the cruel'
arena_monsters[42310] = 'avalanche' -- first monster from 2 arena
arena_monsters[42311] = 'kreebosh the exile'
arena_monsters[42312] = 'the dark dancer'
arena_monsters[42313] = 'the hag'
arena_monsters[42314] = 'slim'
arena_monsters[42315] = 'grimgor guteater'
arena_monsters[42316] = 'drasilla'
arena_monsters[42317] = 'spirit of earth'
arena_monsters[42318] = 'spirit of water'
arena_monsters[42319] = 'spirit of fire'
arena_monsters[42320] = 'webster' -- first monster from 3 arena
arena_monsters[42321] = 'darakan the executioner'
arena_monsters[42322] = 'norgle glacierbeard'
arena_monsters[42323] = 'the pit lord'
arena_monsters[42324] = 'svoren the mad'
arena_monsters[42325] = 'the masked marauder'
arena_monsters[42326] = 'gnorre chyllson'
arena_monsters[42327] = "fallen mooh'tah master ghar"
arena_monsters[42328] = 'deathbringer'
arena_monsters[42329] = 'the obliverator'

function getArenaMonsterIdByName(name)
    name = string.lower(tostring(name))
    for i = 42300, 42329 do
        if tostring(arena_monsters[i]) == name then
            return i
        end
    end
    return 0
end
2:
Code:
local shop = {
	["50cc"] = {
		id = 2160, count = 50, points = 30
	},
	["100cc"] = {
		id = 2160, count = 100, points = 50
	},
	["sacredS"] = {
		id = 7409, count = 1, points = 120
	},
	["sacredS"] = {
		id = 2408, count = 1, points = 120
	},
	["sacredA"] = {
		id = 8925, count = 1, points = 120
	},
	["kaiserA"] = {
		id = 2503, count = 1, points = 135
	},
	["kaiserL"] = {
		id = 2504, count = 1, points = 135
	},
	["magicianR"] = {
		id = 7897, count = 1, points = 135
	},
	["magicianL"] = {
		id = 7896, count = 1, points = 135
	},
	["sacred"] = {
		id = 2646, count = 1, points = 150
			},
	["addon"] = {
		id = 9693, count = 1, points = 100
			},
	["soft"] = {
		id = 6132, count = 1, points = 100
			},
	["light-bow"] = {
		id = 8858, count = 1, points = 80
			},
	["light-arrow"] = {
		id = 2352, count = 1, points = 80
			},
	["vip"] = {
		id = 5785, count = 1, points = 110
	}
}
function onSay(cid, words, param, channel)
	local v = shop[param]
	local check = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = '" .. getPlayerAccountId(cid) .. "' LIMIT 1;")
	local k = check:getDataInt("premium_points")
	check:free()
	if check >= v.points then
		local item = doCreateItemEx(v.id, v.count)
		if doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR then
			doPlayerSendCancel(cid, "Desculpa,você não tem cap.")
		else
			doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Shop: Added " .. v.count .."x " .. getItemInfo(v.id).name .. " to your inventory.")
			db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` - " .. v.points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
		end
	else
		doPlayerSendCancel(cid, "Desculpa,você não tem premium points,compre seus points no shop.")
	end
	return true
end
 
[Error - TalkAction Interface]
data/talkactions/scripts/vip1.lua:onSay
Description:
data/talkactions/scripts/vip1.lua:53: attempt to index local 'v' <a nil value>
stack traceback:
data/talkactions/scripts/vip1.lua:53: in function <data/talkactions/scripts/vip1.lua:48>
 
Code:
local shop = {
	["50cc"] = {
		id = 2160, count = 50, points = 30
	},
	["100cc"] = {
		id = 2160, count = 100, points = 50
	},
	["sacredS"] = {
		id = 7409, count = 1, points = 120
	},
	["sacredS"] = {
		id = 2408, count = 1, points = 120
	},
	["sacredA"] = {
		id = 8925, count = 1, points = 120
	},
	["kaiserA"] = {
		id = 2503, count = 1, points = 135
	},
	["kaiserL"] = {
		id = 2504, count = 1, points = 135
	},
	["magicianR"] = {
		id = 7897, count = 1, points = 135
	},
	["magicianL"] = {
		id = 7896, count = 1, points = 135
	},
	["sacred"] = {
		id = 2646, count = 1, points = 150
			},
	["addon"] = {
		id = 9693, count = 1, points = 100
			},
	["soft"] = {
		id = 6132, count = 1, points = 100
			},
	["light-bow"] = {
		id = 8858, count = 1, points = 80
			},
	["light-arrow"] = {
		id = 2352, count = 1, points = 80
			},
	["vip"] = {
		id = 5785, count = 1, points = 110
	}
}
function onSay(cid, words, param, channel)
	local v = shop[param]
	if v then
		local check = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = '" .. getPlayerAccountId(cid) .. "' LIMIT 1;")
		local k = check:getDataInt("premium_points")
		check:free()
		if k >= v.points then
			local item = doCreateItemEx(v.id, v.count)
			if doPlayerAddItemEx(cid, item) ~= RETURNVALUE_NOERROR then
				doPlayerSendCancel(cid, "Desculpa,você não tem cap.")
			else
				doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Shop: Added " .. v.count .."x " .. getItemInfo(v.id).name .. " to your inventory.")
				db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` - " .. v.points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
			end
		else
			doPlayerSendCancel(cid, "Desculpa,você não tem premium points,compre seus points no shop.")
		end
	else
		doPlayerSendCancel(cid, "Invalid param.")
	end
	return true
end
 
Last edited:
LUA:
[Error - TalkAtion Interface]
data/talkactions/scripts/vip1.lua:OnSay
Decription:
data/talkactions/scripts/vip1.lua:54: attempt to compare number with table stack traceback:
	data/talkactions/scripts/vip1.lua:54: in function <data/talkactions/scripts/vip1.lua:48>
 
LUA:
[Error - TalkAtion Interface]
data/talkactions/scripts/vip1.lua:OnSay
Decription:
data/talkactions/scripts/vip1.lua:54: attempt to compare number with table stack traceback:
	data/talkactions/scripts/vip1.lua:54: in function <data/talkactions/scripts/vip1.lua:48>
Code:
local shop = {
	["50cc"] = {
		id = 2160, count = 50, points = 30
	},
	["100cc"] = {
		id = 2160, count = 100, points = 50
	},
	["sacredS"] = {
		id = 7409, count = 1, points = 120
	},
	["sacredS"] = {
		id = 2408, count = 1, points = 120
	},
	["sacredA"] = {
		id = 8925, count = 1, points = 120
	},
	["kaiserA"] = {
		id = 2503, count = 1, points = 135
	},
	["kaiserL"] = {
		id = 2504, count = 1, points = 135
	},
	["magicianR"] = {
		id = 7897, count = 1, points = 135
	},
	["magicianL"] = {
		id = 7896, count = 1, points = 135
	},
	["sacred"] = {
		id = 2646, count = 1, points = 150
			},
	["addon"] = {
		id = 9693, count = 1, points = 100
			},
	["soft"] = {
		id = 6132, count = 1, points = 100
			},
	["light-bow"] = {
		id = 8858, count = 1, points = 80
			},
	["light-arrow"] = {
		id = 2352, count = 1, points = 80
			},
	["vip"] = {
		id = 5785, count = 1, points = 110
	}
}
function onSay(cid, words, param, channel)
	local v = shop[param]
	if v then
		local check = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = '" .. getPlayerAccountId(cid) .. "' LIMIT 1;")
		local k = check:getDataInt("premium_points")
		check:free()
		if k >= v.points then
			local item = doCreateItemEx(v.id, v.count)
			if doPlayerAddItemEx(cid, item) ~= RETURNVALUE_NOERROR then
				doPlayerSendCancel(cid, "Desculpa,você n?o tem cap.")
			else
				doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Shop: Added " .. v.count .."x " .. getItemInfo(v.id).name .. " to your inventory.")
				db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` - " .. v.points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
			end
		else
			doPlayerSendCancel(cid, "Desculpa,você n?o tem premium points,compre seus points no shop.")
		end
	else
		doPlayerSendCancel(cid, "Invalid param.")
	end
	return true
end
 
Back
Top