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

Monster gives exact lvl

GOD Wille

Excellent OT User
Joined
Jan 11, 2010
Messages
2,826
Solutions
2
Reaction score
815
Location
Sweden
Does any1 know how to fix so, if i kill a demon boss (custom monster as example)
i gives exactly 200 lvls everytime?
 
here a simple way, make monster give 0 exp then go to make a on kill function that add the level. :)
Want that?[to make it more real , it will send exp on player as on killing monster normally ]
LUA:
local monster = "rat"
local lvl = 200
function onkill(cid,target)
if isPlayer(cid) and getCreatureName(target) == monster then
doSendAnimatedText(getThingPos(cid), getExperienceForLevel(lvl).."", TEXTCOLOR_WHITE)
doPlayerAddLevel(cid,lvl)
end
return true
end
 
Last edited:
here a simple way, make monster give 0 exp then go to make a on kill function that add the level. :)
Want that?[to make it more real , it will send exp on player as on killing monster normally ]
LUA:
local monster = "rat"
local lvl = 200
function onkill(cid,target)
if isPlayer(cid) and getCreatureName(target) == monster then
doSendAnimatedText(getThingPos(cid), getExperienceForLevel(lvl).."", TEXTCOLOR_WHITE)
doPlayerAddLevel(cid,lvl)
end
return true
end
Where should i put this?
 
In creaturescripts.xml add
Code:
<event type="kill" name="Monsterlvl" script="killmonster.lua"/>
and in login.lua add
Code:
	registerCreatureEvent(cid, "Monsterlvl")
killmonster.lua
LUA:
--Script by Damagerz
local monster = "rat" --Monster name, remember big and small letters
local lvl = 200 --How much level they will get
function onkill(cid,target)
if isPlayer(cid) and getCreatureName(target) == monster then
doSendAnimatedText(getThingPos(cid), getExperienceForLevel(lvl).."", TEXTCOLOR_WHITE)
doPlayerAddLevel(cid,lvl)
end
return true
end
Rep++
 
hmm.. let me think!! ah i got it.
go to creatureevent --> scripts make new lua and paste
then goto creature..xml paste
Code:
<event type="kill" name="kill" event="script" value="xxxx.lua"/>
then go to login.lua and paste
Code:
 registerCreatureEvent(cid, "kill")
 
Back
Top