Rainbow Physics gun?

Hey, I found something on a sever the other day and it looked pretty interesting.
I kinda suck with colors and hsv coloring so I was wondering if anyone knew something simple that could provide this effect.


Thank you!

You could run Player:SetWeaponColor(…) in a timer to update the color.

Here’s the wiki doc:

Fixed because I am retarded. Thanks Robotboy.

Yeah, I thought it would have something to do with that, just not sure how to go about the physgun part.

Not player color though, but weapon color.

[editline]16th May 2014[/editline]

Basically, this will make all admins and super admins have rainbow physgun

timer.Create( "myhax", 1, 0, function()
	for id, ply in pairs( player.GetAll() ) do
		if ( !ply:IsAdmin() ) then continue end
		local col = HSVToColor( CurTime() % 6 * 60, 1, 1 )
		ply:SetWeaponColor( Vector( col.r / 255, col.g / 255, col.b / 255 ) )
end )

colorin player and weapons per frame it’s heavy?

It’s not per frame, it’s per second.

In the hypothetical case i mean

Not with the serverside function, no.
You might be able to do this cheaply by overriding the MatProxy.

I still haven’t looked extensivly into MatProxies, so I can’t give you a definitive answer.

Sorry for the bump but where would I put this code? And is it called on the serverside or clientside?

In your init.lua and server side because you can’t make superadmins and admins have rainbow physguns from client side

Where is that init.lua?

Make a file in /lua/autorun/server/ and give it a unique name. Paste the code in there

not trying to be annoying but what folder? modification master or???