1
parse("customkill "..Killer.." Infected "..Victim)
Scripts
Lua Scripts/Questions/Helpparse("customkill "..Killer.." Infected "..Victim)
if Ball.X > Goal.X and Ball.X < Goal.X + Goal.W and Ball.Y > Goal.Y and Ball.Y < Goal.Y + Goal.H then 	goal score 	parse sv_restart end
if Ball.X > Goal.X and Ball.X < Goal.X + Goal.W and Ball.Y > Goal.Y and Ball.Y < Goal.Y + Goal.H then 	goal score 	parse sv_restart end
if engi==nil then engi={} end
engi.credits={}
function initArray(f,v)
	local cmd = {}
	for c = 1, f do
		cmd[c] = v
	end
	return cmd
end
function engi.credits.hud(id,tid,color,txt,x,y)
	local toprint = ("©"..color.." "..txt)
	parse('hudtxt2 '..id..' '..tid..' "'..toprint..'" '..x.." "..y)
end
function engi.credits.updatehud(id)
	engi.credits.hud(id,1,"000255000","Money: "..engi.credits.money[id],200,200)
end
addhook("spawn","engi.credits.spawnhud")
function engi.credits.spawnhud(id)
	engi.credits.updatehud(id)
end
addhook("collect","engi.credits.add")
function engi.credits.add(id,iid)
	if (iid==66) then
		engi.credits.money[id]=engi.credits.money[id]+100
		engi.credits.updatehud(id)
	end
	if (iid==67) then
		engi.credits.money[id]=engi.credits.money[id]+1000
		engi.credits.updatehud(id)
	end
	if (iid==68) then
		engi.credits.money[id]=engi.credits.money[id]+10000
		engi.credits.updatehud(id)
	end
	if (iid==56) then
		engi.credits.money[id]=engi.credits.money[id]+100000
		engi.credits.updatehud(id)
	end
end
addhook("say","engi.credits.drop")
function engi.credits.drop(p,t)
	if (t=="dropmoney") then
		menu(p,"Ammount to drop,100,1000,10000,100000")
		return 1
	end
end
addhook("menu","engi.credits.dropmenu")
function engi.credits.dropmenu(id,menu,sel)
	if (menu=="Ammount to drop") and (sel==1) then
		parse ("spawnitem 66 "..(player(id,"tilex")).." "..(player(id,"tiley")))
		parse ("setmoney "..id.." "..(player(id,"money"))-100)
		engi.credits.money[id]=engi.credits.money[id]-100
		engi.credits.updatehud(id)
	end
	if (menu=="Ammount to drop") and (sel==2) then
		parse ("spawnitem 67 "..(player(id,"tilex")).." "..(player(id,"tiley")))
		parse ("setmoney "..id.." "..(player(id,"money"))-1000)
		engi.credits.money[id]=engi.credits.money[id]-1000
		engi.credits.updatehud(id)
	end
	if (menu=="Ammount to drop") and (sel==3) then
		parse ("spawnitem 68 "..(player(id,"tilex")).." "..(player(id,"tiley")))
		parse ("setmoney "..id.." "..(player(id,"money"))-10000)
		engi.credits.money[id]=engi.credits.money[id]-10000
		engi.credits.updatehud(id)
	end
	if (menu=="Ammount to drop") and (sel==4) then
		parse ("spawnitem 56 "..(player(id,"tilex")).." "..(player(id,"tiley")))
		parse ("setmoney "..id.." "..(player(id,"money"))-100000)
		engi.credits.money[id]=engi.credits.money[id]-100000
		engi.credits.updatehud(id)
	end
end
engi.credits.money=initArray(32,2500)
.de


function InTable(n,v)
	local Table = {}
	for i = 0, n, 1 do Table[i] = v end
	return(Table)
end
BallImagePath = "gfx/lua/ball.png"	-- Image = 32*32 (Circle)
GateImagePath = "gfx/lua/gate.png"	-- Image = 64*96 (Rectangle)
WeaponsPush = true	-- Weapons Effect Ball
Ball = { X , Y, XS, YS, Cur }
Pl = { Kick = InTable(32,0) }
CT_Goal = { X, Y}
T_Goal = { X, Y}
ImagesList = {}
addhook("startround","FootBallStart")
addhook("always","FootBallUpdate")
addhook("use","FootBallKick")
addhook("attack","FootBallPush")
function FootBallStart()
	RemoveFromList()
	LoadBall(9,9)
	LoadGates()
end
function SetArea(X,Y,W,H) Area = { X = X * 32 + 16, Y = Y * 32 + 16, W = W * 32 + 16, H = H * 32 + 16 } end
function SetGoal(TEAM,X,Y)
	_G[TEAM.."_Goal"] = { X = X * 32, Y = Y * 32}
end
function ImageToList(Path,X,Y,MODE)
	local ID = image(Path,X,Y,MODE)
	table.insert(ImagesList,ID)
	return(ID)	
end
function RemoveFromList()
	for k, v in pairs(ImagesList) do freeimage(v) end
	ImagesList = {}
end
function LoadBall(X,Y)
	Ball.X, Ball.Y = X * 32 + 16, Y * 32 + 16
	Ball.XS, Ball.YS = 0, 0
	local ID = ImageToList(BallImagePath,Ball.X,Ball.Y,1)
	Ball.Cur = ID
end
function FootBallUpdate()
	local X, Y
	for k, v in pairs(player(0,"table")) do
		X, Y = player(v,"x"), player(v,"y")
		if (Dist(X,Y,Ball.X,Ball.Y) < 32) then
			local RAD = math.atan2(Y - Ball.Y,X - Ball.X)
			local Power = 2
			if (Pl.Kick[v] > 0) then
				Power, Pl.Kick[v] = 12, 0
				msg2(v,"KICK!@C")
				msg2(v,"Kick: OFF")
			end
			Ball.XS = Ball.XS - math.cos(RAD) * Power
			Ball.YS = Ball.YS - math.sin(RAD) * Power
			Ball.X = X - math.cos(RAD) * 33
			Ball.Y = Y - math.sin(RAD) * 33
		 end
	end
	if (Ball.X > Area.W or Ball.X < Area.X) then Ball.XS = -Ball.XS end
	if (Ball.Y > Area.H or Ball.Y < Area.Y) then Ball.YS = -Ball.YS end
	if (Ball.X > Area.W) then Ball.X = Area.W end
	if (Ball.Y > Area.H) then Ball.Y = Area.H end
	if (Ball.X < Area.X) then Ball.X = Area.X end
	if (Ball.Y < Area.Y) then Ball.Y = Area.Y end
	if (Ball.XS > 12) then Ball.XS = 12 elseif (Ball.XS < -12) then Ball.XS = -12 end
	if (Ball.YS > 12) then Ball.YS = 12 elseif (Ball.YS < -12) then Ball.YS = -12 end
	Ball.X, Ball.Y = Ball.X + Ball.XS, Ball.Y + Ball.YS
	imagepos(Ball.Cur,Ball.X,Ball.Y,0)
	Ball.XS, Ball.YS = Ball.XS / 1.05, Ball.YS / 1.05
	if InArea(Ball,CT_Goal.X - 32,CT_Goal.Y - 48,CT_Goal.X + 32,CT_Goal.Y + 48) then parse("restart") msg("T SCORE!") end
	if InArea(Ball,T_Goal.X - 32,T_Goal.Y - 48,T_Goal.X + 32,T_Goal.Y + 48) then parse("restart") msg("CT SCORE!") end
end
function Dist(X1,Y1,X2,Y2)
	return( ((X1 - X2) ^ 2 + (Y1 - Y2) ^ 2) ^ .5 )
end
function FootBallKick(ID)
	local Switch = {"Off","On"}
	if (Pl.Kick[ID] > 0) then Pl.Kick[ID] = 0 else Pl.Kick[ID] = 1 end
	msg2(ID,"Kick: "..Switch[Pl.Kick[ID] + 1])
end
function FootBallPush(ID)
	local WPN = player(ID,"weapontype")
	if (WPN > 0 and WPN < 10 or WPN > 19 and WPN < 41) and WeaponsPush then
		local X = player(ID,"x")
		local Y = player(ID,"y")
		local ROT = player(ID,"rot") - 90
		local FLY = true
		while FLY do
			X, Y = X + math.cos(math.rad(ROT)) * 5, Y + math.sin(math.rad(ROT)) * 5
			if Dist(X,Y,Ball.X,Ball.Y) < 16 then
				local DMG = itemtype(WPN,"dmg") / 4
				Ball.XS, Ball.YS = Ball.XS + math.cos(math.rad(ROT)) * DMG, Ball.YS + math.sin(math.rad(ROT)) * DMG
				break
			else
				if tile(math.ceil(X/32) - 1,math.ceil(Y/32) - 1,"wall") then FLY = false end
			end
		end
	end
end
function InArea(XY,X1,Y1,X2,Y2)
	return( XY.X > X1 and XY.X < X2 and XY.Y > Y1 and XY.Y < Y2 )
end
function LoadGates()
	imagecolor(ImageToList(GateImagePath,CT_Goal.X,CT_Goal.Y,1),0,0,255)
	imagecolor(ImageToList(GateImagePath,T_Goal.X,T_Goal.Y,1),255,0,0)
end
SetArea(2,2,18,18)
SetGoal("CT",18,11)
SetGoal("T",3,11)
FootBallStart()
maybe I will change of it for any improves or changes, but you're the main scripter so you will on credits.