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

Game wolrd

agomez

Member
Joined
Jan 28, 2009
Messages
211
Reaction score
5
how can i put when a player log in the server it appears a message saying:

example:
Test[8] Has entered to the game world
 
data/creaturescripts/loginmessage.lua
LUA:
function onLogin(cid)
doBroadCastMessage("" .. getCreatureName(cid) .. "[ " .. getPlayerLevel(cid) .. "] has entered the game world!")
return true
end

creaturescripts.xml
XML:
<event type="login" name="LoginMessage" event="script" value="loginmessage.lua"/>
 
if you using 8.7(tfs v0.2.9(mystic spirit)) then this script should work

loginmessage.lua
LUA:
function onLogin(cid)
broadcastMessage("" .. getCreatureName(cid) .. "[ " .. getPlayerLevel(cid) .. "] has entered the game world!")
return true
end
creaturescripts.xml
XML:
<event type="login" name="LoginMessage" script="loginmessage.lua"/>

tested it works for me
 
Last edited:
im using tfs 8.6 :P

[16/01/2011 08:32:31] [Error - CreatureScript Interface]
[16/01/2011 08:32:31] data/creaturescripts/scripts/loginmessage.lua:onLogin
[16/01/2011 08:32:31] Description:
[16/01/2011 08:32:31] data/creaturescripts/scripts/loginmessage.lua:2: attempt to call global 'doBroadCastMessage' (a nil value)
[16/01/2011 08:32:31] stack traceback:
[16/01/2011 08:32:31] data/creaturescripts/scripts/loginmessage.lua:2: in function <data/creaturescripts/scripts/loginmessage.lua:1>
[16/01/2011 08:32:31] Download has logged out.
 
Try this one
Code:
function onLogin(cid)
doBroadcastMessage(""..getCreatureName(cid).." [" .. getPlayerLevel(cid) .. "] has entered the game world.", 22)
return true
end

and in creaturescripts.xml
Code:
<event type="login" name="LoginMessage" script="loginmessage.lua"/>
 
Back
Top