Real Vandta
Member
Hello guys, i have error in my script it possible to make this script to TFS 0.4 rev 3777?
Lua:
local config = {
[1] = {5}, -- sorcerer
[2] = {6}, -- druid
[3] = {7}, -- paladin
[4] = {8}, -- knight
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = config[getPlayerVocation(cid)]
if v then
doPlayerSetVocation(cid, v[1])
doCreatureSay(cid, "You are now an "..getPlayerVocationName(cid).."!", TALKTYPE_ORANGE_1)
db.executeQuery("UPDATE `players` SET `name` = '[DNT] "..getCreatureName(cid).."' WHERE `id` = "..getPlayerGUID(cid)..";")
doPlayerSendTextMessage(cid,25,"You will be kicked after 5 Secs automatically after logout you might have a [DNT] and Increase your vocations.")
addEvent(doRemoveCreature, 5*1000, cid, true)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid,"You're empty this item.")
end
return true
end