How to make a realistic RPG/turret fire

Hey there I’m making an FPS shooter-type game and I’m currently scripting a turret that kills the other who tries to enter the other team spawn and I’m not quite sure how to script a realistic RPG that will fire and explode once it hits the target.

Any help?

Make a radius that it can detect players, check their team, make the part on the turret that’s supposed to look at the player, fire the rocket forward from the barrel, when it touches something, create an explosion from the position of the rocket, if a person is caught in the explosion then damage them.

Like @zhenjie2003Alt said. You would have to make a radius to where the turrets can see players. As well as making an 2 object value (or CFrame Value) and naming it killer and team. Put the “team value” inside the player, and the “killer value” inside the enemy (or opponent)

I got that but how do I make the rocket itself and the explosion effect?

Spawn the rocket with a bodyvelocity facing forwards, and theres a built in way of making the explosion effect

Here are 2 Roblox models which you can look at.

alright thanks, I’ll take a look right now