Capture The Flag Gamemode (CTF)

Video
Download

This is a fully functioning CTF gamemode, however I decided to not include a restart function because this is kind of a template for other similar gamemodes to work off of.

Originally I made this for Transport Tycoon’s event thing they had, but (to my knowledge) they never ended up using it, and I didn’t want to see it go to waste so I put it on my Github for free.

I didn’t include any command restrictions as per request, so I would limit all commands using ACE permissions.

12 Likes

Looks nice. Good release!

This looks really fun!

Can flag-holding players shoot guns? If they can, maybe the flag would look better on their back, the same way World of Warcraft did it (reference).

1 Like

Is this mainly for the gamemode of the server to be this? I have a RP server but have fun events to chill so if I would like to put this on there it wouldn’t cause any issues and how about respawn when players die do they respawn at their base or are they dead forever? How do people join teams automatically when they join or is there a command to join a team.

This script is made to be am event script, but can be used as a gamemode.

Players will respawn at a random location near their base when dead, avoiding water if possible.

New players will automatically be put on a team. There is no way to switch teams at this point.

1 Like

Cool cool so I can then test it out at some point!

Is there a timer or any plans for a timer?

There are no plans of adding a timer, but it’s something that I could do

It could make the game a little more competitive, so, although team 1 already has all the flags, team 2 still has a chance to steal, and of course team 1 has a chance to defend, but within the time limit :stuck_out_tongue:

I completely agree. A timer would make the game much more fun. I will add that when I get home and push an update

1 Like

Yes, players who are holding the flag can shoot guns. I maybe move the flag to their back like you said, as they would be more realistic. I might just make a config value so you guys can easily change which bone the flag is attached to

1 Like

nice job ! what if the carrier gets killed ? will it drop the flag to the ground as well ? or what if he gets crashed/disconnected etc

If the character does or disconnects/crashes the flag will drop on the ground.
Players on same team as the flag can immediately return the flag to their base, and players on the opposite team can pick up the flag and get the flag to their base for a point

2 Likes

Any way to remove the overhead names and set up the blips for both teams to be on? Currently diving into the server and client files, been looking thru for a few minutes already… i’ll report back here if i find anything.

Edit: May not be the right way to do this, But for now, To remove overhead player names remove line 136 in server.lua

                    gameInfo.PlayerTeams[playerT].PlayerName = GetPlayerName(playerT)

Removing line 251 client.lua is the correct way to do that. Removing the line that you removed could break alot of stuff

1 Like

Thank you! Any idea how to set the blips for both teams to always be on?

1 Like

Very nice! Thanks for making this, works great on QBus. Now just need to find how I can make it not constantly on, but where players can go to the area away from regular RP and start a game, then exit afterwards. Also so they get items removed from inventory given some guns and ammo during the game, then swap back after the game, and when they die while playing will respawn at the team base…Hmmm

Also found when a game ends the server needs to restart to start another game.

1 Like

You should be able to just restart the script to restart the game. Odd

Tried and says it can’t find, could have been something I did with install or config but I’m wanting to make it auto restart after game finishes. Maybe we can work on this together to make more versatile possibilities for usage. It’s a great concept. Just send me a DM if you’re interested

I’m sorry to disappoint, but I usually only work with other scripters. When I get home I will add an auto-restart on game end function though

1 Like