local ITEM_ID = 7899
local text = "words go here"
function onThink(cid, interval, lastExecution)
if exhaustion.check(cid, 23056) then return true end
if (getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == ITEM_ID) then
doSendAnimatedText(getCreaturePosition(cid), "".. text .."", COLOR_RED)
exhaustion.set(cid, 23056, 2)
end
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 .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
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,'SpellUp')
registerCreatureEvent(cid, "partyAndGuildProtection")
registerCreatureEvent(cid, "PointSystem")
registerCreatureEvent(cid, "Sworddis") ----- THIS IS HOW I PUT IT --->
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
return true
end
local ITEM_ID = 2390
local text = "Oblivion Slayer"
function onThink(cid, interval, lastExecution)
if exhaustion.check(cid, 23056) then return true end
if (getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == ITEM_ID) then
doSendAnimatedText(getCreaturePosition(cid), "".. text .."", COLOR_RED)
exhaustion.set(cid, 23056, 2)
end
return true

local ITEM_ID = 2390
local text = "Oblivion Slayer"
function onThink(interval, lastExecution)
for _, name in ipairs(getOnlinePlayers()) do
local cid = getPlayerByName(name)
if (getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == ITEM_ID) or (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == ITEM_ID) then
doSendAnimatedText(getCreaturePosition(cid), "".. text .."", COLOR_RED)
end
end
return true
end
Add it as type think, also change the slot armor to right and left if you use a weapon, now it's checking if it has a sword on the armor slot.
Although you can also add it as a globalevent (it's the same script as Synthetic_ posted, but added 2 lines so it works as a globalevent).
LUA:local ITEM_ID = 2390 local text = "Oblivion Slayer" function onThink(interval, lastExecution) for _, name in ipairs(getOnlinePlayers()) do local cid = getPlayerByName(name) if (getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == ITEM_ID) or (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == ITEM_ID) then doSendAnimatedText(getCreaturePosition(cid), "".. text .."", COLOR_RED) end end return true end
Then add the time in the globalevent xml line.