How could I achieve Capture Objective / King of The Hill?

If none of this works try on a clean baseplate, if that doesn’t work then r.i.p

Well, you could save the place to a local file and then DM the rbxl file to us so we can look at it. It might be something with the place itself. I had a situation where there was corruption and I had to copy everything over to a new place file and overwrite the old one to clear the problem.

In fact, do that first. Create a new place file and copy everything over and see if there’s still a problem.

1 Like

That’s a good idea. It could work.

Ok, after looking through your place file, I ended up copying the terrain and the map components over to a new baseplate because of all the noise that ACS was generating. With just your map1 and terrain with my scripts, I send your corrected file back to you and deleted your file off my system. I strongly suggest that you edit your DM to me and remove the file there as well. This is for your own security. Here’s what I found:

  1. The zone script that was supposed to be parented under the part was missing (It’s the first script above). If that script is missing, then nothing happens because it’s the one that actually does the detection. I also added an ObjectValue named Team to that same part because the monitoring script will fail if it’s not there (my error).

  2. Under Teams, I saw that you had three teams (Red, Blue, Lobby). I turned the Lobby team auto-assign to off because the lobby team has the same color as the default color. So when you log in, you will be on either the Red or Blue team. The reason behind this is that if you go to the church and you’re in the lobby team, the color will not change because the lobby team color is the default color (I changed it to Lily White in the script to match what you have.).

  3. The monitoring script had some errors in it too. Those have been corrected. I also commented out the remote event code so you don’t need the Events folder under ReplicatedStorage. Remember, I commented them out, not remove them. When you’re ready, you can uncomment them. With that being said however, at some point you will need to provide a timer, scoreboard, and who the winner is to the clients.

On a side note, I don’t use ACS. It’s great for fast game development and such, but for the most part, I don’t like it for personal reasons. But, the King of the Hill does work so when you spawn in and go to the church, that block will change color to your team color.

I’m going to call this mystery solved.

Cheers.

1 Like

Thanks a ton!

Sorry, that would explain yeah
I haven’t parented it because I thought only the 1st script you provided me with was not needed to be there aswell, sorry!

For King of the Hill, two scripts are required, but you could probably get away with one. The reason being that two scripts are required is because the sensor plate runs the spatial query every so often while the monitor script checks the team value every so many seconds. For a common game asset like king of the hill, capture the flag, or domination, I use scripts within the prop itself to handle the functionality of that prop. The monitor script just watches things. That way, I can take the different props and include them in different games, unmodified. It’s a concept known as modular programming.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.