• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua SetCreatureName(InGame)

tetra20

DD
Joined
Jan 17, 2009
Messages
1,316
Solutions
4
Reaction score
327
Location
Egypt
Fixed

Hi. i have compiled setCreatureName lua script.the link to the thread http://otland.net/f35/change-existing-monster-name-game-131643/
it is working good but there is a part that doesn't work.


Main Part
V

LUA:
setCreatureName(cid, ""..getCreatureName.."[Giant]", "A Giant "..getCreatureName(cid).."")
the part that doesn't work
Code:
""..getCreatureName.."[Giant]"


when i look at the monster i find
you see A Giant Rotworm but the name ingame is still a rotworm

Any Help
Rep++


Not Fixed


Monster Doesn't summon after killing it
 
Last edited:
@summ
when i added the function made by scarlet i got 2 problems
1-the monster name
2- the monster doesn't summon back after i kill it

@Fec.....
THANKS... i forgot to put (cid) Repped

- - - Updated - - -

anyway i fixed the first thing
Fixed
1-the monster name change

Not Fixed
2-the monster doesn't summon back after i kill it :S
 
Last edited:
zuma i have added the onSpawn(cid) function and it was working correctly.with no bugs.when i added change monster name(it work also) but when i kill any monster it doesn't summon back for example

i kill a rotworm after 60~ second it should respawn in the same place
 
it doesn't spawn again thats the problem :S

- - - Updated - - -

if i kill any monster in the game it doesn't spawn back i need to restart to spawn back monsters
 
try adding the name change as a delayed event of 100 milliseconds with:
addEvent(setCreatureName, 100, cid, NEWNAME, NEWDESC)
 
i want to say this is my fault that you couldn't understand me
the bug is in source i fucked up something in monster

Regular Monster Summon is
After killing a any monster it should summon after ~1 min

my bug is in source
if anyone could help me through teamviewer
Msg Me...
Thanks all
 
testing....

- - - Updated - - -

Still Nothing.... i am the sure that the bug is in source when i tried to use onSpawn(cid) without setCreatureName it worked

- - - Updated - - -

Thanks for Help
 
LUA:
function onSpawn(cid)
	if math.random(100) < 5 and isMonster(cid) then
	doCreatureSetSkullType(cid, 3)
	setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)) + (getCreatureMaxHealth(cid)/100)* 77)
	addEvent(setCreatureName,100,cid, ""..getCreatureName(cid).."[Champion]", "A "..getCreatureName(cid).."[Champion]")
	doCreatureAddHealth(cid, getCreatureMaxHealth(cid) + (getCreatureMaxHealth(cid)/100)* 77)
	elseif math.random(100) < 3 and isMonster(cid) then
	doCreatureSetSkullType(cid, 4)
	setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)) + (getCreatureMaxHealth(cid)/100)* 140)
		addEvent(setCreatureName,100,cid, ""..getCreatureName(cid).."[Giant]", "A "..getCreatureName(cid).."[Giant]")
	doCreatureAddHealth(cid, getCreatureMaxHealth(cid) + (getCreatureMaxHealth(cid)/100)* 140)
	elseif math.random(100) < 1 and isMonster(cid) then
	doCreatureSetSkullType(cid, 5)
	setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)) + (getCreatureMaxHealth(cid)/100)* 180)
	addEvent(setCreatureName,100,cid, ""..getCreatureName(cid).."[Extreme]", "A "..getCreatureName(cid).."[Extreme]")
	doCreatureAddHealth(cid, getCreatureMaxHealth(cid) + (getCreatureMaxHealth(cid)/100)* 180)
	return true
end
end
 
So it works when you just change health using onSpawn?
I don't see anything wrong with setCreatureName which would affect the spawns.
Are you staying out of the spawn range?
 
LUA:
function onSpawn(cid)
    if math.random(100) < 5 and isMonster(cid) then
    doCreatureSetSkullType(cid, 3)
    setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)) + (getCreatureMaxHealth(cid)/100)* 77)
    addEvent(setCreatureName,100,cid, ""..getCreatureName(cid).."[Champion]", "A "..getCreatureName(cid).."[Champion]")
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid) + (getCreatureMaxHealth(cid)/100)* 77)
    elseif math.random(100) < 3 and isMonster(cid) then
    doCreatureSetSkullType(cid, 4)
    setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)) + (getCreatureMaxHealth(cid)/100)* 140)
        addEvent(setCreatureName,100,cid, ""..getCreatureName(cid).."[Giant]", "A "..getCreatureName(cid).."[Giant]")
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid) + (getCreatureMaxHealth(cid)/100)* 140)
    elseif math.random(100) < 1 and isMonster(cid) then
    doCreatureSetSkullType(cid, 5)
    setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)) + (getCreatureMaxHealth(cid)/100)* 180)
    addEvent(setCreatureName,100,cid, ""..getCreatureName(cid).."[Extreme]", "A "..getCreatureName(cid).."[Extreme]")
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid) + (getCreatureMaxHealth(cid)/100)* 180)
    return true
end
end
how i can make this script work with
Lua Function - Change Existing Monster Name In-Game (https://otland.net/threads/change-existing-monster-name-in-game.131643/)
because when do it monster wont spawn again after death
 
Back
Top