Elite Questbane
Sylphera.com
I have during a long time wanted to learn lua and today I took the first step reading CAREFULLY through the tutorials. Now I finished my first script and I have NO idea if this is fucked up or if it's working. Please correct the script if I made any mistake
How's what I believe the script is working.
1. I pull a lever and the scripts check my level, and if I am lvl 50 or higher then a teleport comes up. At the same time a text message pops up "Escape has been made!"
2. If you are not lvl 50 or higher another message comes up, "You dont..blabla"
3. When the lever is pulled and you pull it back the teleports dissapear and a message comes up "Your escape failed!" if your not lvl 50 or higher a message will come "You dont.. blabla"
How's what I believe the script is working.
1. I pull a lever and the scripts check my level, and if I am lvl 50 or higher then a teleport comes up. At the same time a text message pops up "Escape has been made!"
2. If you are not lvl 50 or higher another message comes up, "You dont..blabla"
3. When the lever is pulled and you pull it back the teleports dissapear and a message comes up "Your escape failed!" if your not lvl 50 or higher a message will come "You dont.. blabla"
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
if getPlayerLevel(cid) >= 50 then
doCreateTeleport(itemid, topos, createpos)
doPlayerSendTextMessage(cid,21,"Escape has been made!")
else
doPlayerSendCancel(cid,"You don't have the required level.")
end
elseif item.itemid == 1946 then
if getPlayerLevel(cid) >= 50 then
doPlayerSendTextMessage(cid,21,"Your escape failed!")
else
doPlayerSendCancel(cid,"You don't have the required level.")
end
end
return TRUE
end
Last edited by a moderator: