function onLogin(cid)
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end
Post your login.lua
function onLogin(cid)
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end
function onLogin(cid)
if getPlayerLastLoginSaved(cid) == 0 then
doPlayerPopupFYI(cid, "Welcome to our OT!\nAND YOUR STORY...")
end
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end
[02/08/2012 00:25:03] Lua Script Error: [CreatureScript Interface]
[02/08/2012 00:25:03] data/creaturescripts/scripts/login.luanLogin
[02/08/2012 00:25:03] data/creaturescripts/scripts/login.lua:2: attempt to call global 'getPlayerLastLoginSaved' (a nil value)
[02/08/2012 00:25:03] stack traceback:
[02/08/2012 00:25:03] [C]: in function 'getPlayerLastLoginSaved'
[02/08/2012 00:25:03] data/creaturescripts/scripts/login.lua:2: in function <data/creaturescripts/scripts/login.lua:1>
function onLogin(cid)
if getPlayerLastLoginSaved(cid) == 0 then
doPlayerPopupFYI(cid, "Welcome to our OT!\nAND YOUR STORY...")
end
return true
end
registerCreatureEvent(cid, "first")
<event type="login" name="first" event="script" value="first.lua"/>
Create , first.lua
Add to your login.lua :
creaturescripts.xml
[02/08/2012 00:42:15] Lua Script Error: [CreatureScript Interface]
[02/08/2012 00:42:15] data/creaturescripts/scripts/first.luanLogin
[02/08/2012 00:42:15] data/creaturescripts/scripts/first.lua:2: attempt to call global 'getPlayerLastLoginSaved' (a nil value)
[02/08/2012 00:42:15] stack traceback:
[02/08/2012 00:42:15] [C]: in function 'getPlayerLastLoginSaved'
[02/08/2012 00:42:15] data/creaturescripts/scripts/first.lua:2: in function <data/creaturescripts/scripts/first.lua:1>
[02/08/2012 00:42:15] Baloma has logged out.
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = .. getPlayerName .. ",Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
doPlayerPopupFYI(cid, "Welcome to our OT!\nAND YOUR STORY...")
end
Try:
Add it to your login.lua
LUA:local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = .. getPlayerName .. ",Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." else doPlayerPopupFYI(cid, "Welcome to our OT!\nAND YOUR STORY...") end
[02/08/2012 01:29:07] Warning: [Event::checkScript] Can not load script. /scripts/login.lua
[02/08/2012 01:29:07] data/creaturescripts/scripts/login.lua:5: unexpected symbol near '..'
local config = {
loginMessage = getConfigValue('loginMessage')
}
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "TYPE HERE.")
end
LUA:local config = { loginMessage = getConfigValue('loginMessage') } local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage if(lastLogin > 0) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "." else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "TYPE HERE.") end
function onLogin(cid)
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end