Northnorial
Member
I got a problem with my script.
Error Message:
Script:
Error Message:
Script:
Code:
local config = {
sorcerer = "1",
druid = "2",
paladin = "3",
knight = "4",
message = "You have chosen your vocation and gained some experience for your adventure.",
exp = "1000",
temple = {x=1021, y=941, z=6}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.uid == 35821 then
if getPlayerStorageValue(cid,51924) < 1 then
if getPlayerLevel(cid) >= 8 then
doPlayerSetVocation(cid, config.sorcerer)
doPlayerSendTextMessage(cid,21,""..config.message.."")
doPlayerAddExp(cid, config.exp)
doPlayerSetTown(cid, 1)
doTeleportThing(cid, config.temple)
setPlayerStorageValue(cid,51924,1)
else
doPlayerSendCancel(cid,"You don't have the required level.")
end
else
doPlayerSendCancel(cid,"You have already chosen your vocation.")
end
end
elseif item.uid == 35822 then
if getPlayerStorageValue(cid,51924) < 1 then
if getPlayerLevel(cid) >= 8 then
doPlayerSetVocation(cid, config.druid)
doPlayerSendTextMessage(cid,21,""..config.message.."")
doPlayerAddExp(cid, config.exp)
doPlayerSetTown(cid, 1)
doTeleportThing(cid, config.temple)
setPlayerStorageValue(cid,51924,1)
else
doPlayerSendCancel(cid,"You don't have the required level.")
end
else
doPlayerSendCancel(cid,"You have already chosen your vocation.")
end
end
elseif item.uid == 35823 then
if getPlayerStorageValue(cid,51924) < 1 then
if getPlayerLevel(cid) >= 8 then
doPlayerSetVocation(cid, config.paladin)
doPlayerSendTextMessage(cid,21,""..config.message.."")
doPlayerAddExp(cid, config.exp)
doPlayerSetTown(cid, 1)
doTeleportThing(cid, config.temple)
setPlayerStorageValue(cid,51924,1)
else
doPlayerSendCancel(cid,"You don't have the required level.")
end
else
doPlayerSendCancel(cid,"You have already chosen your vocation.")
end
end
elseif item.uid == 335824 then
if getPlayerStorageValue(cid,51924) < 1 then
if getPlayerLevel(cid) >= 8 then
doPlayerSetVocation(cid, config.knight)
doPlayerSendTextMessage(cid,21,""..config.message.."")
doPlayerAddExp(cid, config.exp)
doPlayerSetTown(cid, 1)
doTeleportThing(cid, config.temple)
setPlayerStorageValue(cid,51924,1)
else
doPlayerSendCancel(cid,"You don't have the required level.")
end
else
doPlayerSendCancel(cid,"You have already chosen your vocation.")
end
end
return TRUE
end