darkmu
Well-Known Member
Can someone give me a light ..
I'm trying to make a system for TFS 1.3 in which the knights will be able to exchange their strongest skill for another skill.
Example:
I have skill 120 of sword, however I want to switch to AXE, so I will invert take the values of the AXE put in the skill of SWORD and the SWORD put in the AXE.
I'm trying to make a system for TFS 1.3 in which the knights will be able to exchange their strongest skill for another skill.
Example:
I have skill 120 of sword, however I want to switch to AXE, so I will invert take the values of the AXE put in the skill of SWORD and the SWORD put in the AXE.
Lua:
local skills, tableSkills = {
[1] = {'Club', function(player) return player:getSkillLevel(SKILL_CLUB) end, bestSkill = false},
[2] = {'Sword', function(player) return player:getSkillLevel(SKILL_SWORD) end, bestSkill = false},
[3] = {'Axe', function(player) return player:getSkillLevel(SKILL_AXE) end, bestSkill = false}
}, {}
local function checkStrongSkill(player, tableSkill)
local skillMaisAlto = 0
for i = 1, #skills do
if skills[i][2](player) > skillMaisAlto then
table.insert(tableSkills, {skillName = skills[i][1], skillNumber = skills[i][2](player), bestSkill = true})
skillMaisAlto = skills[i][2](player)
else
table.insert(tableSkills, {skillName = skills[i][1], skillNumber = skills[i][2](player), bestSkill = false})
end
end
return tableSkills
end
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
--local check = checkStrongSkill(player, skills)
--print(#check)
return TRUE
end