--hey there, could you maybe credit me if you use this script? 🥺👉👈
--it doesn't really take much if you think about it, 
--just write "made by kirb the korb" and ur done, thanks.
 
freeslot("sfx_draw")
sfxinfo[sfx_draw].caption = "Paintbrush"

addHook("PlayerThink", function(player)
	if not (player.mo) then return end
	if (player.cmd.buttons & BT_CUSTOM2)
	and mapheaderinfo[gamemap].paint
	local joex = player.mo.x+FixedMul(250*FRACUNIT, cos(player.mo.angle))
	local joey = player.mo.y+FixedMul(250*FRACUNIT, sin(player.mo.angle))
	local joez = player.mo.z+FixedMul(250*FRACUNIT, sin(player.aiming))
			if not player.weapondelay
	player.mo.digtimer = 25
    player.weapondelay = 1*TICRATE/4
		local gmobj = P_SpawnGhostMobj(player.mo)
		gmobj.fuse = 600
		gmobj.flags = MF_SOLID|MF_PUSHABLE
		P_TeleportMove(gmobj, joex, joey, joez)
		end
	end
end)
addHook("PlayerThink", function(player)
	if not (player.mo) then return end
	if (player.cmd.buttons & BT_CUSTOM3)
	and mapheaderinfo[gamemap].paint
	local joex = player.mo.x+FixedMul(250*FRACUNIT, cos(player.mo.angle))
	local joey = player.mo.y+FixedMul(250*FRACUNIT, sin(player.mo.angle))
	local joez = player.mo.z+FixedMul(250*FRACUNIT, sin(player.aiming))
		if not (player.pflags & PF_THOKKED)
		local gmobj = P_SpawnGhostMobj(player.mo)
		gmobj.state = S_THOK
		gmobj.fuse = 9999
		P_TeleportMove(gmobj, joex, joey, joez)
		end
	end
end)
addHook("PlayerThink", function(player)
	if not (player.mo) then return end
	if (player.cmd.buttons & BT_CUSTOM1)
	and mapheaderinfo[gamemap].paint
	local joez = player.mo.z+FixedMul(250*FRACUNIT, sin(player.aiming))
	local joex = player.mo.x+FixedMul(250*FRACUNIT, cos(player.mo.angle))
	local joey = player.mo.y+FixedMul(250*FRACUNIT, sin(player.mo.angle))
		if not (player.pflags & PF_THOKKED)
		local gmobj = P_SpawnGhostMobj(player.mo)
		gmobj.state = S_HOOP
		gmobj.scale = 2*FRACUNIT/3
		gmobj.fuse = 99999999
		gmobj.color = player.mo.color
		gmobj.colorized = true
		P_TeleportMove(gmobj, joex, joey, joez)
		P_TeleportMove(gmobj, gmobj.x, gmobj.y, gmobj.z + 40*FRACUNIT)
		S_StartSound(mobj, sfx_draw)
		end
	end
end)
addHook("PlayerThink", function(player)
	if not (player.mo) then return end
	if player.mo
	and mapheaderinfo[gamemap].paint
	local joex = player.mo.x+FixedMul(250*FRACUNIT, cos(player.mo.angle))
	local joey = player.mo.y+FixedMul(250*FRACUNIT, sin(player.mo.angle))
		local joez = player.mo.z+FixedMul(250*FRACUNIT, sin(player.aiming))
		if not (player.pflags & PF_THOKKED)
		local gmobj = P_SpawnGhostMobj(player.mo)
		gmobj.state = S_BLUESPHERE
		gmobj.scale = 2*FRACUNIT/6
		gmobj.fuse = 4
		gmobj.color = player.mo.color
		gmobj.colorized = true
		P_TeleportMove(gmobj, joex, joey, joez)
		P_TeleportMove(gmobj, gmobj.x, gmobj.y, gmobj.z + 40*FRACUNIT)
		end
	end
end)

addHook("PlayerThink", function(player)
	if not (player.mo) then return end
	if (player.cmd.buttons & BT_WEAPONNEXT)
	and mapheaderinfo[gamemap].paint
	player.mo.color = P_RandomRange(SKINCOLOR_AETHER, SKINCOLOR_ROSY)
		end
end)



addHook("PlayerThink", function(player)
	if not (player.mo) then return end
	if (player.cmd.buttons & BT_WEAPONPREV)
	and mapheaderinfo[gamemap].paint
	player.mo.color = SKINCOLOR_PBLACK
		end
end)

