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

Player receive message on rookgaard lvl8 help

carre

Advanced OT User
Joined
Apr 23, 2013
Messages
881
Solutions
1
Reaction score
157
Location
Sweden
Hi

Where Can I find a script that when the player reached to level 8 and get a broadcast message on rookgaard that he can leave the rookgard?
 
in creaturescripts/scripts/yourscript.lua
Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
      
        if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 8) then
                doPlayerSendTextMessage(cid, 22, "Your msg")
                end
        return TRUE
end
then add this in creaturescript/creaturescript.xml
XML:
<event type="advance" name="msg" event="script" value="yourscript.lua"/>
then in in creaturescripts/scripts/login.lua add this
Lua:
registerCreatureEvent(cid, "yourscriptname")
 
in creaturescripts/scripts/yourscript.lua
Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
     
        if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 8) then
                doPlayerSendTextMessage(cid, 22, "Your msg")
                end
        return TRUE
end
then add this in creaturescript/creaturescript.xml
XML:
<event type="advance" name="msg" event="script" value="yourscript.lua"/>
then in in creaturescripts/scripts/login.lua add this
Lua:
registerCreatureEvent(cid, "yourscriptname")
thanks! I will try this tomorrow cuz im tired and need go to sleep.
 
thanks! I will try this tomorrow cuz im tired and need go to sleep.
i did everything and still don't get the message.
my server is tfs 0.3.7
Post automatically merged:

in creaturescripts/scripts/yourscript.lua
Lua:
function onAdvance(cid, skill, oldlevel, newlevel)
    
        if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 8) then
                doPlayerSendTextMessage(cid, 22, "Your msg")
                end
        return TRUE
end
then add this in creaturescript/creaturescript.xml
XML:
<event type="advance" name="msg" event="script" value="yourscript.lua"/>
then in in creaturescripts/scripts/login.lua add this
Lua:
registerCreatureEvent(cid, "yourscriptname")
i did everything and still don't get the message.
my server is tfs 0.3.7 and sorry for double spam.
 
make sure that the name="" in the creaturescripts.xml and the one you used on registerCreatureEvent(cid, "yourscriptname") is the same name
 
make sure that the name="" in the creaturescripts.xml and the one you used on registerCreatureEvent(cid, "yourscriptname") is the same name
I named Rookgaard lvl 8 message.lua and registerCreatureEvent(cid, "Rookgaard lvl 8 message.")
+creaturescripts.xml still don't work
Post automatically merged:

<event type="advance" name="msg" event="script" value="Rookgaard lvl 8 message.lua"/>
registerCreatureEvent(cid, "Rookgaard lvl 8 message") on login.lua
 
Last edited:
Try to name it without 'spaces', call it rookgaard_8_level_message, anyway so complicated, name it rookgaard_login, and keep other events for category login once in rookgaard in one file.
 
Try to name it without 'spaces', call it rookgaard_8_level_message, anyway so complicated, name it rookgaard_login, and keep other events for category login once in rookgaard in one file.
Still don't work... is there another way to fix it?
 
XML:
<event type="advance" name="RookgaardMSG" event="script" value="Rookgaard lvl 8 message.lua"/>

and in login.lua
Lua:
registerCreatureEvent(cid, "RookgaardMSG")
 
XML:
<event type="advance" name="RookgaardMSG" event="script" value="rookgaard_msg.lua"/>


Rename the lua file to rookgaard_msg.lua
 
XML:
<event type="advance" name="RookgaardMSG" event="script" value="rookgaard_msg.lua"/>


Rename the lua file to rookgaard_msg.lua
I did and still don't get the message when I reached to lvl 8

registerCreatureEvent(cid, "rookgaard_msg") <<<<< my login.lua
<event type="advance" name="RookgaardMSG" event="script" value="rookgaard_msg.lua"/>

Code:
function onAdvance(cid, skill, oldlevel, newlevel)
     
        if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 8) then
                doPlayerSendTextMessage(cid, 22, "you can leave rookgaard for now")
                end
        return TRUE
end

Also no error in my console.
 
Lua:
registerCreatureEvent(cid, "RookgaardMSG")
In login.lua
it work :)
thank you very so much!
Post automatically merged:

One more last thing.

I only want player get this message 1x not all the time when they reach level 8 again
 
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
      
        if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 8) then
                doPlayerSendTextMessage(cid, 22, "Your msg")
                doCreatureSetStorage(cid, 99963, 1)
                end
        return TRUE
end
 
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
     
        if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 8) then
                doPlayerSendTextMessage(cid, 22, "Your msg")
                doCreatureSetStorage(cid, 99963, 1)
                end
        return TRUE
end
it work.
thanks man!
 
Back
Top