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

Simple request!

richux

Tibera.org
Joined
Aug 18, 2008
Messages
3,666
Reaction score
26
Location
---------
I saw one guy requesting this(in wrong board) and decided to repost it, but this time on right board, cuz I need this feature too.

So all I need is simple script that would shove a messege for player if he reaches, for example, level 8.

That should not be hard. :)



Thank you!
 
Code:
  function onAdvance(cid, skill, oldlevel, newlevel)
         if newlevel == 8 then
            doPlayerSendTextMessage(cid, 17, "Gz!")
         end
         return TRUE
end

As in the other thread, you need to add an event to register in login.lua
 
Code:
  function onAdvance(cid, skill, oldlevel, newlevel)
         if newlevel == 8 then
            doPlayerSendTextMessage(cid, 17, "Gz!")
         end
         return TRUE
end

As in the other thread, you need to add an event to register in login.lua

I added your piece of code in login.lua. and this line in creaturescripts.xml

LUA:
	<event type="login" name="advance200" event="script" value="login.lua"/>

It loads fine, but does not work. Any ideas? :o
 
The file adv_level8.LUA:
Code:
				function onAdvance(cid, skill, oldlevel, newlevel)
	if ((newlevel == 8) and (oldlevel == 7)) then
	   doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Gratz!")
 end
 return TRUE
end

Now you need add this line on the login.LUA script:
Code:
	   registerCreatureEvent(cid, "AdvanceTo8")

...and in the creaturescripts.XML you need add:
Code:
  <event type="advance" name="AdvanceTo8" event="script" value="adv_level8.lua" />
 
The file adv_level8.LUA:
Code:
				function onAdvance(cid, skill, oldlevel, newlevel)
	if ((newlevel == 8) and (oldlevel == 7)) then
	   doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Gratz!")
 end
 return TRUE
end

Now you need add this line on the login.LUA script:
Code:
	   registerCreatureEvent(cid, "AdvanceTo8")

...and in the creaturescripts.XML you need add:
Code:
  <event type="advance" name="AdvanceTo8" event="script" value="adv_level8.lua" />

works! But I would like if the messege would appear on screen(not only in default chat). And how can I change color of letters? :D
 
Look in the script:
Code:
				function onAdvance(cid, skill, oldlevel, newlevel)
	if ((newlevel == 8) and (oldlevel == 7)) then
	   doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Gratz!")
 end
 return TRUE
end
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Gratz!")

You can change to:
MESSAGE_STATUS_CONSOLE_RED
MESSAGE_EVENT_ORANGE
MESSAGE_STATUS_CONSOLE_ORANGE
MESSAGE_STATUS_WARNING
MESSAGE_EVENT_ADVANCE
MESSAGE_EVENT_DEFAULT
MESSAGE_STATUS_DEFAULT
MESSAGE_INFO_DESCR
MESSAGE_STATUS_SMALL
MESSAGE_STATUS_CONSOLE_BLUE

Ex:
Code:
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Gratz!")
 
Look in the script:
Code:
				function onAdvance(cid, skill, oldlevel, newlevel)
	if ((newlevel == 8) and (oldlevel == 7)) then
	   doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Gratz!")
 end
 return TRUE
end
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "Gratz!")

You can change to:


Ex:
Code:
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Gratz!")

luv ya!:wub:
 
Back
Top