To get started, this script will enable players on a server ( or in single player ) to add themselfs a trail. Just put this script in your servers autorun folder and name it something wierd. You will need to restart the server and then join it. To add yourself a tail, just open CLIENTSIDE console and put “trailme” in it, or something else, depends if you changed the command in the lua script and distributed the command only to admins. It will give you a red trail thats glows in the dark. Sadly, i have no idea what so ever on how to remove the trail on death or something and seeing as the command ADDS you a trail, just repeat the command until you have a very red and thick trail. Just so you all know, if you die with a trail on, it will say and if you press the backwards button, its as if your alive and the trail moves( its kinda funny ). If you have an idea on how to improve this idea ( lol ) post it here and i will see what i can do. If i cannot do it due to lack of knowlidge you may ofcourse do it and if you want redistribute your version of it BUT GIVE MEH TEH CREDITZ!!!

if CLIENT then
	CreateClientConVar("trailmod_mat", "trails/electric.vmt", false, false)

	function trailmod_open()

		local DermaPanel = vgui.Create( "DFrame" ) -- Creates the frame itself
		DermaPanel:SetPos( 50,50 ) -- Position on the players screen
		DermaPanel:SetSize( 150, 225 ) -- Size of the frame
		DermaPanel:SetTitle( "TrailMod Made by Ningaglio" ) -- Title of the frame
		DermaPanel:SetVisible( true )
		DermaPanel:SetSizable( true )
		DermaPanel:SetDraggable( true ) -- Draggable by mouse?
		DermaPanel:ShowCloseButton( true ) -- Show the close button?
		DermaPanel:MakePopup() -- Show the frame

		local TestingComboBox = vgui.Create( "DComboBox", DermaPanel )
		TestingComboBox:SetPos( 10, 35 )
		TestingComboBox:SetSize( 100, 185 )
		TestingComboBox:SetMultiple( false ) -- Don't use this unless you know extensive knowledge about tables
		TestingComboBox:AddItem( "trails/plasma.vmt" ) -- Add our options
		TestingComboBox:AddItem( "trails/electric.vmt" )
		TestingComboBox:AddItem( "trails/love.vmt" )
		TestingComboBox:AddItem( "trails/physbeam.vmt" )
		TestingComboBox:AddItem( "trails/smoke.vmt" )
		TestingComboBox:AddItem( "trails/tube.vmt" )

		local MainMenuSheet = vgui.Create( "DPanel", DermaPanel ) -- We create a panel so we can draw shit on; if we use the frame, it comes up transparent for some reason
		MainMenuSheet:SetPos( 125, 50 )
		MainMenuSheet:SetSize( DermaPanel:GetWide() - 25, DermaPanel:GetTall() - 25 )
		MainMenuSheet.Paint = function()
			if TestingComboBox:GetSelectedItems() and TestingComboBox:GetSelectedItems()[1] then -- make sure something is selected if not we get uber spam of errors
				local OurStringThing = "Your selection is: "..TestingComboBox:GetSelectedItems()[1]:GetValue().."!" -- This was a pain in the ass to figure out; this gets the name of the option chosen
				surface.SetFont( "default" )
				surface.SetTextColor( 255, 255, 255, 255 )
				surface.SetTextPos( 50, 50 )
				surface.DrawText( OurStringThing ) -- Draws the text

	concommand.Add("trailme_menu", trailmod_open)

function trailme( ply )
	util.SpriteTrail(ply, 0, Color(255,0,0), false, 15, 1, 4, 1/(15+1)*0.5, TestingComboBox:GetSelectedItems()[1]:GetValue())

concommand.Add( "trailmod_enable", trailme )

sadly, the derma part of the mod isnt completly ready yet so hey! who cares? i hope you folks like this and i hope that soon this will be a nice addon.

I hope you know that this is purely Clientside? Else then that, try to make it serverside as the next challenge.

no, if it is in the autorun folder and not autorun/client, it WILL work multiplayer. if you want to test it, goto and then tell me if it works when you do ‘trailme’ in console :stuck_out_tongue:

No, you’re using CLIENT hooks. Only you would be able to see your own trail. Nobody else would see yours, and you wouldn’t see theirs.

i can assure you, it works on my server, so if you would like to test it?

BTW: i woulndt be releasing this if it didnt work in multiplayer cause whats the point of having a trail if no one is gonna say its cool :smiley:


also, my server is a real one thats hosted and not created by my gmod :wink:

It’s okay I guess, but I prefer the one in PAC.