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

broadcast then kill player

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,398
Reaction score
165
Hello otlanders meyby someone can help me , i was search script in forum but cant find .
i want if player other player it Broadcast . ect - Lukamika Was Owned By......
i using 0.3.6
rep++
 
LUA:
function onKill(cid, target)
if isPlayer(target) then
doBroadcastMessage("".. getCreatureName(target) .." was owned by ".. getCreatureName(cid) .."")
end
return true
end
 
Last edited:
data/creaturescripts/creaturescripts.xml
XML:
<event type="login" name="own_register" event="script" value="own.lua"/>
<event type="kill" name="own" event="script" value="own.lua"/>

data/creaturescripts/scripts/own.lua
LUA:
function onLogin(cid)
	registerCreatureEvent(cid, 'own')	
	return true
end

function onKill(cid, target, lastHit)
	if isPlayer(cid) and isPlayer(target) and lastHit then
		doBroadcastMessage(getCreatureName(target) ..' was owned by '.. getCreatureName(cid), 27)
	end
	return true
end
 
why need 2x lines
<event type="login" name="own_register" event="script" value="own.lua"/>
<event type="kill" name="own" event="script" value="own.lua"/>
???? i are nobish at scripting sorry for nobish questions/sorry for english
 
that's no bug :p change 27 for the one you like:
red is 18
LUA:
MESSAGE_FIRST = 18
MESSAGE_STATUS_CONSOLE_RED = MESSAGE_FIRST
MESSAGE_EVENT_ORANGE = 19
MESSAGE_STATUS_CONSOLE_ORANGE = 20
MESSAGE_STATUS_WARNING = 21
MESSAGE_EVENT_ADVANCE = 22
MESSAGE_EVENT_DEFAULT = 23
MESSAGE_STATUS_DEFAULT = 24
MESSAGE_INFO_DESCR = 25
MESSAGE_STATUS_SMALL = 26
MESSAGE_STATUS_CONSOLE_BLUE = 27
 
LUA:
function onLogin(cid)
	registerCreatureEvent(cid, 'own')	
	return true
end
 
function onKill(cid, target, lastHit)
	if isPlayer(cid) and isPlayer(target) and lastHit then
		doBroadcastMessage(getCreatureName(target) ..' was owned by '.. getCreatureName(cid))
	end
	return true
end
 
Back
Top