• 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!

Lua reward

Calon

Experienced Member
Joined
Feb 6, 2009
Messages
1,070
Reaction score
21
im searching for script that when player get xx lvl he get reward 10 cc .
rep++
 
Code:
<!-- MappingFOR -->

function onAdvance(cid)
	if getPlayerLevel(cid) == [xx] then
	addPlayerItem(cid, 2160, 10)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulation! You get 10 CC, you must love that OTS so much :D")
    end
    return true
end
 
In creaturescrips.xml add
Code:
	<event type="advance" name="Reward" event="script" value="Reward.lua"/>
In login.lua
After
Code:
	registerCreatureEvent(cid, "Mail")
add
Code:
	registerCreatureEvent(cid, "Reward")
Add this script to the creaturescripts > scripts
Reward.lua
Lua:
--Script by Sonical
local level = 100 --Edit your own level to get item
local item = 2160 --What item he/she will get
local count = 10 --How many?
function onAdvance(cid)
	if getPlayerLevel(cid) == level then
	doPlayerAddItem(cid, item, count)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to level 100 and you really deserve your reward!")
    end
    return TRUE
end

@MappingFOR: I think your script got one bug :thumbup:
 
Back
Top