• Server Connecter
    2 replies, posted
ok what i need is a lua file that has a player run just a player side command once the player hits a world postion so say they hit (random numbers) world cords 12 32 45 that player would either open up their steam doing steam://connect/IP or the command connect IP just for them so i can have a lobby server
bump
something along these lines: [lua] hook.Add( "Think", "MovePlayerToServer", function () if LocalPlayer():GetPos() == Vector( 12, 32, 45 ) then RunConsoleCommand( "connect", "123.456.789.0:27015" ) end end ) [/lua] [editline]09:03PM[/editline] Here's some thing a lot better though; [lua] hook.Add( "Think", "MovePlayerToServer", function () local entsToSwitch = ents.FindInBox( Vector(-32,-32,-32), Vector(32,32,32) ) --Change these two vectors to another two which represent 2 opposing corners of a box within the 3D world for k,v in pairs (entsToSwitch) do if v:IsValid() and v == LocalPlayer() then RunConsoleCommand( "connect", "123.456.789.0:27015" ) end end end ) [/lua]
Sorry, you need to Log In to post a reply to this thread.