Call Me Taffy
Call Me Maybe
- Joined
- Aug 9, 2009
- Messages
- 651
- Reaction score
- 123
I wanted my code to check if the player was level 150, with magic level 100, and the right vocation. uid = 19001 on the item, and it's correct in actions.xml. Also, I'm using TFS 0.3.5. Here's what i got to, with the current error:
Script:
And here's the error:
If anyone could help, it would be greatly appreciated.
Script:
Code:
local playerVoc = getPlayerVocation(cid)
local playerLevel = getPlayerLevel(cid)
local playerMlvl = getPlayerMagLevel(cid)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 19001
then if playerVoc == 1
then if playerLevel == 100
then if playerMlvl == 100
then doSendAnimatedText(getPlayerPosition(cid), "Promoted!", TEXTCOLOR_RED)
doPlayerAddItem(cid, 7755)
setPlayerVocation(cid, 5)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
return true
else
doPlayerSendCancel(cid, "You need to grow some weakling...")
end
end
end
end
end
And here's the error:
[11/08/2009 22:25:42] Lua Script Error: [Action Interface]
[11/08/2009 22:25:42] data/actions/scripts/pyro_promo.lua
[11/08/2009 22:25:42] internalGetPlayerInfo(). Player not found
[11/08/2009 22:25:42] Lua Script Error: [Action Interface]
[11/08/2009 22:25:42] data/actions/scripts/pyro_promo.lua
[11/08/2009 22:25:43] internalGetPlayerInfo(). Player not found
[11/08/2009 22:25:43] Lua Script Error: [Action Interface]
[11/08/2009 22:25:43] data/actions/scripts/pyro_promo.lua
[11/08/2009 22:25:43] luaGetPlayerMagLevel(). Player not found
If anyone could help, it would be greatly appreciated.