• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help Script

jbh1993

New Member
Joined
Jan 3, 2012
Messages
109
Reaction score
2
OK, well can someone make me a script? and i Say Thank you For it. btw

Ok well i need a script..

If player storage 85987, 1 then he can use if not he cant use it.

Cancel Message "Sorry "PlayerName" you are not Allowed to use this scroll"

Use x item do broadcast "Gratz "playername" has just used Second Promotion Scroll"
Set player vocation.
if
5-9
6-10
7-11
8-12

And Send magic effect to player position id 27.

Thanks, if you cant understand this comment and ill explain it better..
Love you OtLand.net
 
Lua:
local config = {
        magicEffect = 27
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerStorageValue(cid, 85987) == 1 then
                if getPlayerVocation(cid) >= 5 and getPlayerVocation(cid) <= 8 then
                        doPlayerSetPromotionLevel(cid, 2)
                        doBroadcastMessage("Gratz, " .. getPlayerName(cid) .. "has just used the Second Promotion Scroll!", 18)
                        doRemoveItem(item.uid)
                        doSendMagicEffect(getPlayerPosition(cid), config.magicEffect)
                else
                        doPlayerSendCancel(cid, "Sorry " .. getPlayerName(cid) .. ", but you are not the required vocation to use this scroll.")
                end
                return true
        end
        doPlayerSendCancel(cid, "Sorry " .. getPlayerName(cid) .. ", you are not allowed to use this scroll.")
        return false
end

You're welcome.
 
Last edited by a moderator:
It is depending on witch distro he is using. If he is not using any TFS then the script is okay. Else if he's using TFS then the script should look like this:

Lua:
local config = {
        magicEffect = 27
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerStorageValue(cid, 85987) ~= 1 then
                if getPlayerPromotionLevel(cid) < 2 then
                        doPlayerSetPromotionLevel(cid, 2)
                        doBroadcastMessage("Gratz, " .. getPlayerName(cid) .. "has just used the Second Promotion Scroll!", 18)
                        doRemoveItem(item.uid)
                        doSendMagicEffect(getPlayerPosition(cid), config.magicEffect)
                else
                        doPlayerSendCancel(cid, "Sorry " .. getPlayerName(cid) .. ", but you are not the required vocation to use this scroll.")
                end
                return true
        end
        doPlayerSendCancel(cid, "Sorry " .. getPlayerName(cid) .. ", you are not allowed to use this scroll.")
        return false
end

doPlayerSetVocation is not working right for any TFS. It is giving error to the player next time he dies/logouts.

Before you are using the TFS script, go to your vocation.xml and be sure that you have the second promotion (vocationid: 9,10,11,12)
Code:
fromvoc=""
is right placed.

As i see that you are trying to give the player your new vocation, then the [fromvoc=""] should look like this:

Sorcerer:
Code:
fromvoc="5"
Druid:
Code:
fromvoc="6"
Paladin:
Code:
fromvoc="7"
Knight:
Code:
fromvoc="8"
 
Icy yours did not work sorry, But thanks for the help so fast ;)

Mooosie Yours did work thank you for the edit. ;) but the storage thing was wrong i had to put it to this

Lua:
local config = {
        magicEffect = 27
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerStorageValue(cid, 85987) >= 1 then
                if getPlayerPromotionLevel(cid) < 2 then
                        doPlayerSetPromotionLevel(cid, 2)
                        doBroadcastMessage("Gratz, " .. getPlayerName(cid) .. "has just Gotten the Rebirth Vocation!", 18)
                        doRemoveItem(item.uid)
                        doSendMagicEffect(getPlayerPosition(cid), config.magicEffect)
                else
                        doPlayerSendCancel(cid, "Sorry " .. getPlayerName(cid) .. ", but you need to be first rebirth to use this scroll.")
                end
                return true
        end
        doPlayerSendCancel(cid, "Sorry " .. getPlayerName(cid) .. ", you are not allowed to use this scroll.")
        return false
end
 
hey guys! im new in all this scripting and a noob! i need some help understanding a few things in this script first what does if getPlayerPromotionLevel(cid) < 2 then
doPlayerSetPromotionLevel(cid, 2) mean? and i got some problems in the storage.. im asking where do u get those numbers the 85987? do u just do random numbers? please it would be great if someone explains this to me :)
 
hey guys! im new in all this scripting and a noob! i need some help understanding a few things in this script first what does if getPlayerPromotionLevel(cid) < 2 then
doPlayerSetPromotionLevel(cid, 2) mean? and i got some problems in the storage.. im asking where do u get those numbers the 85987? do u just do random numbers? please it would be great if someone explains this to me :)

The "if getPlayerPromotionLevel(cid) < 2 then doPlayerSetPromotionLevel(cid, 2)" In plain english means, If the players promotion level is less than 2, then give the player the 2nd promotion.
And the 85987 is just a storage number thats not currently being used, by any other scripts.
 
Back
Top