Lua_run

How do I get this to restart a map?

http://puu.sh/ku18h/de7fe61106.png

The point_servercommand entity doesn’t work and I have no knowledge in lua, please help me.

What gamemode are you making the map for?

http://wiki.garrysmod.com/page/Global/RunConsoleCommand

point_servercommand does work, the gamemode just has to have it as an entity to be interpreted and ran.

Shoot, yeah, totally forgot to say. It’s Garry’s Mod.

Yes? I’ve tried this, but it always makes the server crash.

It does work… just not in garry’s mod because they disabled it for some reason. I think map makers were using it to give themselves admin status on rp servers or something, or ban people that they hated from using the servers that ran their maps.

Again, it works fine in Garry’s Mod if you have an point entity to interpret it.

Here’s a VMF I whipped up, can you tell me what I am doing wrong?

That looks perfect map side. Now just have this an entity to run the command:


ENT.Type = "point"

function ENT:AcceptInput( name, activator, caller, data )
   data = string.Explode( " ", data:lower() )
   
   RunConsoleCommand( data[1], data[2] ) -- Note that this is just a hacky way of calling the commands you specified; with single word commands or ones with multiple arguments, you'll need to account for that in the command run.
end

Define “Entity,” like the ones in hammer or an actual entity file in the /lua folder?

/lua/entities/point_servercommand.lua

Can also be defined as a gamemode entity.

… I placed it in /autorun/…

Anways, it works now. Thank so much for helping me.