Forum

> > CS2D > Scripts > Anti-Bot score farm
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Anti-Bot score farm

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Anti-Bot score farm

SkullFace
User Off Offline

Zitieren
I've been trying that when you kill a bot, you don't get the score for killing that bot. So, that the usgn rank wouldn't be full of bot-spawn killer users and such.

This was my try. I honestly don't know what I'm doing here.

1
2
3
4
5
6
7
8
addhook("kill","noBotScoreFarm")
function noBotScoreFarm(killer,victim,weapon,x,y,killoid,assistant)
	local scoreSet = player(id,"score") - 1
	if player(id,"bot") == true then
	parse("setscore "..id.." "..scoreSet.." ")
	msg("works")
	end
end

I feel like I need to call the 'victim' parameter but don't know how to detect if its a bot or not.

alt Re: Anti-Bot score farm

Yunuu
User Off Offline

Zitieren
The id value is nil in your script. Change victim to id on line 2 or use my script:
1
2
3
4
5
6
addhook("kill","kill_hook")
function kill_hook(killer, victim, weapon, x, y, object, assistant)
	if player(victim,"bot") then 
		parse("setscore "..killer.." "..(player(killer,"score") - 1))
	end
end

alt Re: Anti-Bot score farm

SkullFace
User Off Offline

Zitieren
After I've found some motivation to do this and time, here it is.
This time with customkill "X"

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
addhook("spawn","isBotSpawn")	
function isBotSpawn(id)

	if player(id,"bot") == true then
	parse ("setmoney "..id.." 16000")
	parse ("speedmod "..id.." -5")
	parse ("setarmor "..id.." 0")
	parse ("setmaxhealth "..id.." 250")
	parse ("equip "..id.." 4")
	parse ("equip "..id.." 24")
	end
end

addhook("hit","ifBotHealth")
function ifBotHealth(id)

	if player(id,"bot") == true then
	if player(id,"health") < 175 then
	parse("customkill 0 X "..id.." ")
	end
	end
end

I've set their hp to 250 so they don't die accidentally by a player.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht