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

Solved Action Problem.

Lares

Member
Joined
Feb 8, 2010
Messages
315
Reaction score
7
Hey i have stupid problem with very easy script:

Lua:
function onUse(cid, item, frompos, item2, topos)

local efekt = {30, 35, 40, 45, 50} --k/p/s/d/all
local vocation = getPlayerVocation(cid)

if item.itemid == 11449 then

	if vocation == 4 then
		if getPlayerLevel(cid) >= 150 then
			if getPlayerSkillLevel(cid, 7) >= 5 then
				if getPlayerSkillLevel(cid, 5) >= 80 then
					if getPlayerStorageValue(uid, 5050) == 1 then
						doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Done.")
					else
						doPlayerSetStorageValue(uid, 5050, 1)
						doSendMagicEffect(getPlayerPosition(cid), efekt[1])
						doRemoveItem(item.uid)
					end
				end
			end			
		end
	end
return TRUE
end

And Error:

Code:
[10/08/2010 21:21:03] [Error - Action Interface] 
[10/08/2010 21:21:03] data/actions/scripts/quest/questDT.lua:onUse
[10/08/2010 21:21:03] Description: 
[10/08/2010 21:21:03] data/actions/scripts/quest/questDT.lua:10: attempt to compare number with boolean
[10/08/2010 21:21:03] stack traceback:
[10/08/2010 21:21:03] 	data/actions/scripts/quest/questDT.lua:10: in function <data/actions/scripts/quest/questDT.lua:1>

Its 10 line:

Lua:
			if getPlayerSkillLevel(cid, 7) >= 5 then
 
Last edited:
7 is not a valid skill, these are the valid ones:
Code:
SKILL_FIST (0) = Fist Fighting
SKILL_CLUB (1) = Club Fighting
SKILL_SWORD (2) = Sword Fighting
SKILL_AXE (3) = Axe Fighting
SKILL_DISTANCE (4) = Distance Fighting
SKILL_SHIELD (5) = Shielding
SKILL_FISHING (6) = Fishing
also what tfs version?
 
Code:
SKILL_FIST = 0
SKILL_CLUB = 1
SKILL_SWORD = 2
SKILL_AXE = 3
SKILL_DISTANCE = 4
SKILL_SHIELD = 5
SKILL_FISHING = 6
SKILL__MAGLEVEL = 7
SKILL__LEVEL = 8

TFS 0.3.6pl1
 
Yes i know but i dont knew that "SKILL__MAGLEVEL = 7" is bad.

Now i use getPlayerMagLevel(cid) and is good.

Thx for help, Rep.
 
Back
Top