juansanchez
Advanced OT User
- Joined
- Apr 2, 2015
- Messages
- 223
- Reaction score
- 151
Hey people, i'm having a problem with a new vocation in my server, and i was wondering if someone could help me.
I created this new vocation, and in my server players are allowed to buy skills.
This new vocation uses fist as it main skill. And also uses 2 weapons (which i'm not being able to make it work, i can only use 1 weapon, can anyone help me with this as well?)
I made the script for skill fist, nice and clean like so:
But whenever i try to buy the skill, this happends:
As if it doesn't recognize the new vocation.
Can anyone help me?
I'm using TFS 0.4
I created this new vocation, and in my server players are allowed to buy skills.
This new vocation uses fist as it main skill. And also uses 2 weapons (which i'm not being able to make it work, i can only use 1 weapon, can anyone help me with this as well?)
I made the script for skill fist, nice and clean like so:
if(param == "skillfist") then
if getPlayerSkillLevel(cid, SKILL_FIST) >= 350 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode ter skill acima de 350.")
return TRUE
end
if not isKnocker(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Somente Knockers podem comprar skill de fist.")
return TRUE
end
if getPlayerItemCount(cid, 9971) >= 1 then
if getCreatureCondition (cid, CONDITION_ATTRIBUTES) == FALSE then
local pid = getPlayerGUID(cid)
local fist = getPlayerSkillLevel(cid, SKILL_FIST)
doPlayerRemoveItem(cid, 9971, 1)
setPlayerStorageValue(cid,11548,os.time()+0)
doRemoveCreature(cid)
db.executeQuery("UPDATE `player_skills` SET `value` = " .. (fist + 1) .. ", `count` = 0 WHERE `skillid` = 1 and `player_id` = " .. pid .. ";")
return TRUE
else
doPlayerSendCancel (cid, "Voce nao pode ter nem uma magia ativa para comprar skills.")
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não possui a quantidade necessária para comprar.")
return TRUE
end
end
But whenever i try to buy the skill, this happends:
[19:19:08.583] [Error - TalkAction Interface]
[19:19:08.584] data/talkactions/scripts/comprar.luanSay
[19:19:08.585] Description:
[19:19:08.585] data/talkactions/scripts/comprar.lua:392: attempt to call global
'isKnocker' (a nil value)
[19:19:08.586] stack traceback:
[19:19:08.587] data/talkactions/scripts/comprar.lua:392: in function <data/talk
actions/scripts/comprar.lua:1>
As if it doesn't recognize the new vocation.
Can anyone help me?
I'm using TFS 0.4