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

Solved GetCreatureByName

tetra20

DD
Joined
Jan 17, 2009
Messages
1,315
Solutions
4
Reaction score
323
Location
Egypt
Hi I Have Got a Noob Error.that i can't seem to fix it
Capture.jpg

this is the error part
Lua:
local count = getMonsterInfo(getMonsterInfo(getCreatureByName("rotworm")).experience * 15)

Please Help :)

Full Script
Lua:
function onKill(cid, target, damage, flags)
local percent = 0.5
local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)
local count = math.floor(((getMonsterInfo("rotworm").experience*exp)*percent))
 if isMonster(target) and isPlayer(cid) and getCreatureSkullType(target) == 2 then
doPlayerAddExperience(cid, count)
doPlayerSendCancel(cid,"You Have Got More "..count.."")
 doSendMagicEffect(getPlayerPosition(cid), 14)
 end
 return true
 end
 
Last edited:
i dunno, just play around with it until you figure something out:
Lua:
local experience = getMonsterInfo("rotworm").experience
if experience != false then
	local count = experience * 15
end

Refer to otservDir/docs/LUA_FUNCTIONS for function list and some documentation.
 
summ i can put creatureName as paramter but i have a custom monster that doesn't have a .xml in monsters

- - - Updated - - -

@Znote your script fixed few things for me Thanks
@Summ Thanks too
there is another error using znote Script

gonna try to fix it myself

- - - Updated - - -

(You must spread some Reputation around before giving it to Summ again.)

haha Znote got 1 more rep bar because of me

- - - Updated - - -

Fixed... posted the fixed version in the main post
 
Last edited:
Back
Top