local storage = 54321
if storage == nil or storage == -1 then
for i = 1, 5 do
doPlayerAddBlessing(cid, i)
end
doPlayerSetStorageValue(cid, storage, 1)
end
storages cant be nil by default lolUse this instead! Put it inside your data/creaturescripts/scripts/login.lua right after first line function onLogin(cid).
Xeraphus' code will give everyone blessing everytime he or she logins.Code:local storage = 54321 if storage == nil or storage == -1 then for i = 1, 5 do doPlayerAddBlessing(cid, i) end doPlayerSetStorageValue(cid, storage, 1) end
Did you find my banana?storages cant be nil by default lol
also if you're putting it in default login.lua put the loop under the lastLogin part of the code instead of using storage
still lookingDid you find my banana?
Use this instead! Put it inside your data/creaturescripts/scripts/login.lua right after first line function onLogin(cid).
Xeraphus' code will give everyone blessing everytime he or she logins.Code:local storage = 54321 if storage == nil or storage == -1 then for i = 1, 5 do doPlayerAddBlessing(cid, i) end doPlayerSetStorageValue(cid, storage, 1) end
function onLogin(cid)
local BLESSINGS, amount, missing = {"Wisdom of Solitude", "Spark of the Phoenix", "Fire of the Suns", "Spiritual Shielding", "Embrace of Tibia"}, 0, {}
for i = 1, 5 do
if getPlayerBlessing(cid, i) then amount = (amount+1) else table.insert(missing, BLESSINGS) end
end
if amount == 1 then s='' else s='s' end
doPlayerSendTextMessage(cid,20,'You have '..amount..' blessing'..s..' ('.. amount*20 ..'%).\nMissing blessings: '..table.concat(missing, ", "))
return true
end
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
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
str = str .. " Welcome to Natura!"
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "BlessCheck")
registerCreatureEvent(cid, "Advance")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "VipCheck")
registerCreatureEvent(cid, "TempleTeleporter")
registerCreatureEvent(cid, "forever amulet")
registerCreatureEvent(cid, "skull amulet")
registerCreatureEvent(cid, "charge amulet")
registerCreatureEvent(cid, "SpellUp")
registerCreatureEvent(cid, "rebirth")
registerCreatureEvent(cid, "maxlvl")
registerCreatureEvent(cid, "Aol")
registerCreatureEvent(cid, "PWNED")
registerCreatureEvent(cid, "InfoAdv")
registerCreatureEvent(cid, "InfoDeath")
registerCreatureEvent(cid, "summonDeath")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "LMSSummon")
registerCreatureEvent(cid, "LMSAttack")
registerCreatureEvent(cid, "LMSTarget")
registerCreatureEvent(cid, "CreateTeleport")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
return true
end
Any ideas?Code:function onLogin(cid) for i = 1, 5 do doPlayerAddBlessing(cid, i) end return true end
use the script i posted.Any ideas?
I did. I posted it in login.lua i still dont recieve blessings when a new char login...use the script i posted.
i said where to put it
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
function onLogin(cid)
for i = 1, 5 do
doPlayerAddBlessing(cid, i)
end
return true
end
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
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
str = str .. " Welcome to Natura!"
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "BlessCheck")
registerCreatureEvent(cid, "Advance")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
registerCreatureEvent(cid, "VipCheck")
registerCreatureEvent(cid, "TempleTeleporter")
registerCreatureEvent(cid, "forever amulet")
registerCreatureEvent(cid, "skull amulet")
registerCreatureEvent(cid, "charge amulet")
registerCreatureEvent(cid, "SpellUp")
registerCreatureEvent(cid, "rebirth")
registerCreatureEvent(cid, "maxlvl")
registerCreatureEvent(cid, "Aol")
registerCreatureEvent(cid, "PWNED")
registerCreatureEvent(cid, "InfoAdv")
registerCreatureEvent(cid, "InfoDeath")
registerCreatureEvent(cid, "summonDeath")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "LMSSummon")
registerCreatureEvent(cid, "LMSAttack")
registerCreatureEvent(cid, "LMSTarget")
registerCreatureEvent(cid, "CreateTeleport")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
return true
end
[CODE\]
i said put the script inside your default login.luaI did. I posted it in login.lua i still dont recieve blessings when a new char login...
Here is my login.lua
Code:local config = { loginMessage = getConfigValue('loginMessage'), useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')) } function onLogin(cid) for i = 1, 5 do doPlayerAddBlessing(cid, i) end return true end function onLogin(cid) local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10) end local accountManager = getPlayerAccountManager(cid) if(accountManager == MANAGER_NONE) then 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 str = str .. " Welcome to Natura!" end doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str) elseif(accountManager == MANAGER_NAMELOCK) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?") elseif(accountManager == MANAGER_ACCOUNT) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.") end if(not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end registerCreatureEvent(cid, "Mail") registerCreatureEvent(cid, "GuildMotd") registerCreatureEvent(cid, "BlessCheck") registerCreatureEvent(cid, "Advance") registerCreatureEvent(cid, "ReportBug") registerCreatureEvent(cid, "AdvanceSave") registerCreatureEvent(cid, "VipCheck") registerCreatureEvent(cid, "TempleTeleporter") registerCreatureEvent(cid, "forever amulet") registerCreatureEvent(cid, "skull amulet") registerCreatureEvent(cid, "charge amulet") registerCreatureEvent(cid, "SpellUp") registerCreatureEvent(cid, "rebirth") registerCreatureEvent(cid, "maxlvl") registerCreatureEvent(cid, "Aol") registerCreatureEvent(cid, "PWNED") registerCreatureEvent(cid, "InfoAdv") registerCreatureEvent(cid, "InfoDeath") registerCreatureEvent(cid, "summonDeath") registerCreatureEvent(cid, "onPrepareDeath") registerCreatureEvent(cid, "PlayerDeath") registerCreatureEvent(cid, "ZombieAttack") registerCreatureEvent(cid, "LMSSummon") registerCreatureEvent(cid, "LMSAttack") registerCreatureEvent(cid, "LMSTarget") registerCreatureEvent(cid, "CreateTeleport") registerCreatureEvent(cid, "Idle") if(config.useFragHandler) then registerCreatureEvent(cid, "SkullCheck") end return true end [CODE\]
if(accountManager == MANAGER_NONE) then
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
str = str .. " Welcome to Natura!"
end