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

Lua skull Broadcast

Erikas Kontenis

Board Moderator
Staff member
Board Moderator
Joined
Jul 3, 2009
Messages
1,868
Reaction score
575
Location
Lithuania
can someone fix this script ? i self made it but nothing good for me :D the script dont got any erros :D in console then loading and then getting black skull :D please help me :D i will rep ++ :)

Code:
function onThink(cid)
       local name = getCreatureName(cid)
	   local skullNames = {"Yellow", "Green", "White", "Red", "Black"}
					local creatureSkull = getCreatureSkullType(cid)
					if creatureSkull ~= SKULL_Black then
                doBroadcastMessage("Omg " ..  name .. " is on killing spree!")
                end
        return TRUE
end
 
You're using this as a globalevent? Also, what is the script supposed to do? o_O

i using it as creature script becouse function onThink...

it do that if player get black skull will by broadcast that player who got black skull is on killing spree !

its easy but i noob as allways ;( tried much :D i thinked about global events but its impossible... i thinked that mayby its function onAdvance
 
try this:
function onKill(cid, target)
local name = getCreatureName(cid)
local skull = getCreatureSkullType(cid)
if(isPlayer(target)) then
if(skull == SKULL_BLACK) then
doBroadcastMessage("Omg " .. name .. " is on killing spree!")
end
end
return TRUE
end
 
WTF... EDITED... I'll post the script after downloaded your server version ;D

EDIT:

are you killing players to test it?
 
possible this one?


Code:
function onAdvance(cid, newskull, oldskull)
local name = getCreatureName(cid)
local skull = getCreatureSkullType(cid)
if(skull == SKULL_BLACK) then
doBroadcastMessage("Omg " .. name .. " is on killing spree!")
end
end
return TRUE
end
 
Oo? to me it worked...

ok, let's go in steps:

1 - Open your data/creaturescripts/creaturescripts.xml replace all by this:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<event type="login" name="PlayerLogin" event="script" value="login.lua"/>

<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>

<event type="think" name="Idle" event="script" value="idle.lua"/>
<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>

<event type="kill" name="Kill" event="script" value="kill.lua"/>
</creaturescripts>

2 - go to data/creaturescripts/scripts, make a copy of any file .lua and rename it to kill.lua, open delete all the contents and paste it:
function onKill(cid, target)
local name = getCreatureName(cid)
local skull = getCreatureSkullType(cid)
if(isPlayer(target)) then
if(skull == SKULL_BLACK) then
doBroadcastMessage("Omg " .. name .. " is on killing spree!")
end
end
return TRUE
end

3 - Open your data/creaturescripts/scripts/login.lua and replace all by this:
local config = {
loginMessage = getConfigValue('loginMessage')
}

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, "Idle")
registerCreatureEvent(cid, "SkullCheck")
registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "Kill")
return true
end

4 - save all the new files, close adn open the server and have fun!

it works for me:
98733244.jpg
 
ok :D

Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
	<event type="login" name="PlayerLogin" event="script" value="login.lua"/>

	<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
	<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
	<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
	 <event type="death" name="Azerus" event="script" value="azerus.lua"/>  
	 <event type="advance" name="levelUp" event="script" value="levelUp.lua"/>
	 <event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>


	<event type="think" name="Idle" event="script" value="idle.lua"/>
	<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>  
    <event type="advance" name="reward" event="script" value="reward.lua"/>
	<event type="advance" name="level" event="script" value="level.lua"/>
    <event type="logout" name="demonOakLogout" event="script" value="demonOakLogout.lua"/>
    <event type="death" name="demonOakDeath" event="script" value="demonOakDeath.lua"/>  
	<event type="kill" name="BountyHunter" script="kill.lua"/>
	<event type="attack" name="WarAttack" event="script" value="war_attack.lua"/>
    <event type="kill" name="WarKill" event="script" value="war_kill.lua"/>
	[B]<event type="kill" name="skull broadcast" event="script" value="frag.lua"/>[/B]
	<event type="kill" name="ArenaKill" event="script" value="arenakill.lua"/>
</creaturescripts>

the thing in login.lua

Code:
registerCreatureEvent(cid, "frag")

frag.lua

Code:
function onKill(cid, target)
local name = getCreatureName(cid)
local skull = getCreatureSkullType(cid)
if(isPlayer(target)) then
if(skull == SKULL_BLACK) then
doBroadcastMessage("Omg " .. name .. " is on killing spree!")
end
end
return TRUE
end

blackskull.png


100% Strange
 
Back
Top