RazorBlade
Retired Snek
Alright everyone, gather 'round the fire now. It's time to sing a song!
Actually, we'll save the song for later. I've just created a universal experience scroll that operates in two ways. If you're a VIP, it gives you 10,000,000 experience, stopping you at level 200. However, if you're not a VIP and you use it, it'll only give you 2,500,000 experience and it'll stop you at level 150. I've tested it fully on TFS Crying Damson 0.3.6 pl1.
First, in actions.xml put this somewhere.
After you have this, go to your scripts and go to other. Make a file called exp.lua and paste the following.
If you should encounter any problems, leave a comment and tell me. I only tested this on 0.3.6pl1 so if you have issues on an earlier version, I don't have an earlier version to adapt it. There shouldn't be any issues though, since the functions I used are quite basic. If you like it, comment and rep me
Have fun! ;D :ninja:
Actually, we'll save the song for later. I've just created a universal experience scroll that operates in two ways. If you're a VIP, it gives you 10,000,000 experience, stopping you at level 200. However, if you're not a VIP and you use it, it'll only give you 2,500,000 experience and it'll stop you at level 150. I've tested it fully on TFS Crying Damson 0.3.6 pl1.
First, in actions.xml put this somewhere.
Code:
<action itemid="7492" event="script" value="other/exp.lua"/> <!-- Exp Item -->
After you have this, go to your scripts and go to other. Make a file called exp.lua and paste the following.
Code:
--RazorBlade's custom experience scroll script. All credits go to RazorBlade. Comment and/or add reputation if you like it. This is fully tested.--
function onUse(cid, item, fromPosition, itemEx, toPosition) --Function We're Using.--
if getPlayerLevel(cid) < 201 then --Checks if the character is level 200 or lower.--
if getPlayerStorageValue(cid,50000) == 1 then --This is the storage and value I use for VIP. If yours is different, change it here.--
doPlayerAddExperience(cid, 10000000) --This is the amount of experience you'll gain as a VIP.--
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You gained 10,000,000 experience!") --Sends the player a message saying they've gained 10 million experience.--
doRemoveItem(item.uid, 1) --Removes the experience scroll or item that you use. Doesn't have to be a scroll. Since it's removing the item.uid, rather than removing it from the player, you don't have to be holding the item.--
elseif getPlayerLevel(cid) < 151 then --If they don't qualify under the circumstances above, it'll move onto this one instead and checks if they're level 150 or lower.--
doPlayerAddExperience(cid, 2500000) --This is the amount of experience you'll gain as a Non-VIP. Notice we aren't checking for a storage value this time. We don't need to if they aren't a VIP. We already checked for VIP above.--
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You gained 2,500,000 experience!") --Sends the player a message saying they've received 2.5 million experience.--
doRemoveItem(item.uid, 1) --Again, removes the experience scroll or item you have chosen.--
else --If it doesn't qualify under either, it moves to the line below.--
doPlayerSendCancel(cid, "Sorry, you can't be higher than level 150 unless you're a VIP.") --Sends a cancel message telling them that they can't use this higher than level 150 unless they are a VIP.--
end --Needed after an else. Will end the last if or function used.--
else --If it doesn't qualify under either, but IS a VIP, it'll recognize that you're a VIP and that you're over level 200 and move to the next line.--
doPlayerSendCancel(cid, "Sorry, you can't be higher than level 200.") --Sends a cancel message telling them they can't use this higher than level 200.--
end --Needed after else, and will end our second if.
end --Ends the function
--Notice that the cancel message for Non-VIP comes before the one for VIP, even though the function checks VIP before checking Non-VIP.--
--The else works for the last used if or elseif, and the last else will be for the first if. This is important to remember when creating scripts with more than one if.--
If you should encounter any problems, leave a comment and tell me. I only tested this on 0.3.6pl1 so if you have issues on an earlier version, I don't have an earlier version to adapt it. There shouldn't be any issues though, since the functions I used are quite basic. If you like it, comment and rep me
Have fun! ;D :ninja:
Last edited: