• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Level Reward!

Nightss

Normal People
Joined
May 18, 2013
Messages
55
Reaction score
12
Location
Mexicali
Hello, :)
This Scripts Is For You "Use" And For Reward Have You One Level!
Is 100% Me...!

YourOt/data/actions/scripts
LevelR.lua;

Lua:
local levelup = 1 --- Level Up
local level = 100 --- Level For Use Item

function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerLevel(cid) <= level then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You Need A Reached Level ".. level .." For Up ".. levelup .." Level! .")
     doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
return doSendMagicEffect(fromPosition, CONST_ME_POFF)
end

 doRemoveItem(item.uid, 1)
  doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Congratz!")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_BLUE)
         doSendAnimatedText(getPlayerPosition(cid), "LevelUp!", 18)
return doPlayerAddLevel(cid, levelup)
end

In Actions.xml;

XML:
<action itemid="XXXX" event="script" value="LevelR.lua" />


Thanks For Watch!
 
Last edited:
Look at the word in red

nivel

What is Nivel?? it should be level

Lua:
local levelup = 1 --- Level Up
local level = 100 --- Level For Use Item
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
if getPlayerLevel(cid) <= nivel then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You Need A Reached Level ".. level .." For Up ".. levelup .." Level! .")
     doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
return doSendMagicEffect(fromPosition, CONST_ME_POFF)
end
 
 doRemoveItem(item.uid, 1)
  doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Congratz!")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_BLUE)
         doSendAnimatedText(getPlayerPosition(cid), "LevelUp!", 18)
return doPlayerAddLevel(cid, levelup)
end

Fixed Version

Lua:
local levelup = 1 --- Level Up
local level = 100 --- Level For Use Item
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
if getPlayerLevel(cid) <= level then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You Need A Reached Level ".. level .." For Up ".. levelup .." Level! .")
     doSendAnimatedText(getPlayerPosition(cid), "Failed!", 180)
return doSendMagicEffect(fromPosition, CONST_ME_POFF)
end
 
 doRemoveItem(item.uid, 1)
  doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "Congratz!")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_BLUE)
         doSendAnimatedText(getPlayerPosition(cid), "LevelUp!", 18)
return doPlayerAddLevel(cid, levelup)
end
 
Back
Top