Im making a game where two teams battle to control 3 catapults in order to do damage to the other team’s base. Therefore, I need a script that can detect what team is on the catapult and can rotate it the correct amount of degrees to face the opposing team’s base.
Is there a script that would work well with my idea?
You can manipulate the catapult’s primary parts’ CFrame to look at either base, by instance reference, position Vector3, CFrame, etc. For figuring out who is on it, you could use touched events on parts, but a cleaner and reliable way would be to use WorldRoot:GetPartBoundsInRadius around the catapult, finding if any are a humanoid, and if so, referencing the player from said character and reading what team they are. From there you could do math to figure out who’s the majority, like, 3 reds > 2 blues, catapult starts tweening/CFraming towards the blue side.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.