Request for simple lua script

A lua script that makes the client exec(run) the commands you like

For a server?
If so ulx already has it built in,
Assmod has a plugin and
Not sure a New Admin

Okay I have ulx, where do I put the commands I want the client to run?

It’s !cexec name command

But it exec only when I use the command and with the players that are at my server at that specific time, I want that it exec that command for all players that enter my server… But thx for the try :3

If you want it auto give we 2 hours, I’m shopping at moment and I’ll do when I’m back

if you want manual it’s

!cexec * command

[editline]10:09AM[/editline]

I take it you want it so if the player joins the server it runs a command

also, what command is it

thank you so much by the help ;D, do it at your time ^^, the commands are “rate 35000, cl_cmdrate 100, cl_updaterate 100, bind t rm_ragdolize, bind p rm_reset, rm_getupcountdown 1,
rm_postprocessing 1” , thak you again for not letting this thread die ;D

You cannot run them commands from lua, there clientside and binds

What are you talking about? It is totally possible, except for the binds…

[lua]
hook.Add( “PlayerInitialSpawn”, “PlayerInitialSpawnCommands”, function( ply )
ply:ConCommand( “rate 35000” );
ply:ConCommand( “cl_cmdrate 100” );
ply:ConCommand( “cl_updaterate 100” );
ply:ConCommand( “rm_getupcountdown 1” );
ply:ConCommand( “rm_postprocessing 1” );
end)
[/lua]

Sorry, thats what i ment

[editline]12:03PM[/editline]

:3:

[editline]12:03PM[/editline]

:black101:

[editline]12:09PM[/editline]

[lua]for k,v in pairs(player.GetAll()) do
v:ConCommand("<command here>")
end
[/lua]

\o/ yay thanks, that goes on autorun/server ? =D thank you again.

No, just autorun

No, just autorun/server.

O ok, sorry

I also recomend adding a Message to tell you its been done

[editline]11:57AM[/editline]

Reason:

Becasue people may think you are hacking them by changing there commands :buddy::cheers:

Okay thank you! ^^

[editline]11:55PM[/editline]

still waiting for one answer at this thread…http://www.facepunch.com/showthread.php?t=771621&page=3

After yesterdays update that will no longer work, so here’s a replacement.

Client:


usermessage.Hook("spawn_commands", function(um)
	local m_Command = um:ReadString()
	local m_ID = um:ReadShort()
		
	if (LocalPlayer().ConCommand) then
		LocalPlayer():ConCommand(m_Command)
	else
		hook.Add("InitPostEntity", "ReceiveSpawnCommand"..m_ID, function()
			LocalPlayer():ConCommand(m_Command)
		end )
	end
end )

Server:


local spawn_commands = {
	"rate 35000",
	"cl_cmdrate 100",
	"cl_updaterate 100",
	"rm_getupcountdown 1",
	"rm_postprocessing 1",
}

hook.Add("PlayerInitialSpawn", "SendSpawnCommands", function()
	for k, v in pairs(spawn_commands) do
		umsg.Start("spawn_commands", ply)
			umsg.String(v)
			umsg.Short(k)
		umsg.End()
	end
end )

I’m impressed, thank you ^^.