• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent [onKill] for warOts, give item, broadcast the kills number

andypsylon

be be
Joined
Jan 13, 2009
Messages
772
Reaction score
65
Location
de/pl
for this query

as in the title

in data\creaturescripts\creaturescripts.xml insert:
XML:
    <event type="kill"    name="killCount"    event="script" value="onKillCount.lua"/>

in data\creaturescripts\scripts\login.lua insert:
Lua:
-- ver. 1.1 2011-12-09
-- author tfs, otland.net/members/andypsylon
doCreatureSetStorage(cid, 6000, -1) -- storrage for Current frags like in onKill script
registerCreatureEvent(cid, "killCount")
create data\creaturescripts\scripts\onKillCount.lua and insert:
Lua:
-- ver. 1.1 2011-12-09
-- author tfs, otland.net/members/andypsylon
local c = {
	item = 6500, -- reward itemid
	store = 6000, -- storage for Current frags like in login script
	tstore = 7000, -- Total Storage value for kills
	dstore = 8000, -- Total Storage value for deaths
	table = {
		{"Smashed!", 189, 1},
		{"Dead!", 190, 2},
		{"Owned!", 18, 3},
		{"Pwnt!", 215, 4}
	}
}
function onKill(cid, target)
	if(not isPlayer(target)) then return true end
	
	local getStor = getCreatureStorage(cid, c.store)
	local rand = math.random(1, #c.table)
	local name = getCreatureName(cid)

	doCreatureSetStorage(cid, c.store, (getStor + 1))
	doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
	doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

	doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
	doPlayerAddItem(cid, c.item, c.table[rand][3])

	if(getStor == 5) then
		doBroadcastMessage(name .. " is on killing spree! He killed 5 players!")
	elseif(getStor == 10) then
		doBroadcastMessage(name .. " is dominating! He killed 10 players!")
	elseif(getStor == 25) then
		doBroadcastMessage(name .. " is CRAZY! He killed 25 players!")
	elseif(getStor == 50) then
		doBroadcastMessage(name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
	elseif(getStor == 100) then
		doBroadcastMessage("Bow down to your new god "..name.." has 100 frags!")
	end

	return true
end
 
Last edited:
The broadcast doesnt work and i dont get any errors :/
 
still no broadcast :/
 
i dont get any storage and i get only the 6000 storage -1, and i change broadcast but didnt work!
 
for this query

as in the title

in data\creaturescripts\creaturescripts.xml insert:
XML:
    <event type="kill"    name="killCount"    event="script" value="onKillCount.lua"/>

in data\creaturescripts\scripts\login.lua insert:
Lua:
-- ver. 1.1 2011-12-09
-- author tfs, otland.net/members/andypsylon
doCreatureSetStorage(cid, 6000, -1) -- storrage for Current frags like in onKill script
registerCreatureEvent(cid, "killCount")
create data\creaturescripts\scripts\onKillCount.lua and insert:
Lua:
-- ver. 1.1 2011-12-09
-- author tfs, otland.net/members/andypsylon
local c = {
	item = 6500, -- reward itemid
	store = 6000, -- storage for Current frags like in login script
	tstore = 7000, -- Total Storage value for kills
	dstore = 8000, -- Total Storage value for deaths
	table = {
		{"Smashed!", 189, 1},
		{"Dead!", 190, 2},
		{"Owned!", 18, 3},
		{"Pwnt!", 215, 4}
	}
}
function onKill(cid, target)
	if(not isPlayer(target)) then return true end
	
	local getStor = getCreatureStorage(cid, c.store)
	local rand = math.random(1, #c.table)
	local name = getCreatureName(cid)

	doCreatureSetStorage(cid, c.store, (getStor + 1))
	doCreatureSetStorage(cid, c.tstore, (getCreatureStorage(cid, c.tstore) +1))
	doCreatureSetStorage(target, c.dstore, (getCreatureStorage(cid, c.dstore) + 1))

	doSendAnimatedText(getThingPosition(target), c.table[rand][1], c.table[rand][2])
	doPlayerAddItem(cid, c.item, c.table[rand][3])

	if(getStor == 5) then
		doBroadcastMessage(name .. " is on killing spree! He killed 5 players!")
	elseif(getStor == 10) then
		doBroadcastMessage(name .. " is dominating! He killed 10 players!")
	elseif(getStor == 25) then
		doBroadcastMessage(name .. " is CRAZY! He killed 25 players!")
	elseif(getStor == 50) then
		doBroadcastMessage(name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
	elseif(getStor == 100) then
		doBroadcastMessage("Bow down to your new god "..name.." has 100 frags!")
	end

	return true
end

You just made CTRL + C and changed somethings. But my script is still better than that.

ORIGINAL POST
http://otland.net/f82/some-scripts-you-need-open-war-server-131729/#post1275792
 
do not piss me off
you can simply script not write!
I already write better english with google-tr. than you scripts :p
everything you listed, had other people wrote. bb

@down
bla bla bla
you not know even HOW COMPARE these scripts, cu
go further to ask people, to do scripts for you :D
 
Last edited:
I love andy to death! :D REP!!
 
Back
Top