So I got the basis of this down my problem is that I want the boss to shoot to you and then past and behind you, I can’t just use a blahblah.CFrame*CFrame.new(25,0,0)(sorry I forgot how to do the block of code thing) because then depending on the characters angle It’ll just shoot to the side of them. The problem with just shooting to the character’s coords is that you can just walk backwards to avoid the bullets (video)
The key to this working is that the npc is always facing your character, this is most easily achieved by using CFrame.LookAt(npc pos, ur chr pos) I used this really simple repeat to do that
script.Parent.Walking.Changed:Connect(function(val)
if val == true then
repeat
wait()
chr:SetPrimaryPartCFrame(CFrame.lookAt(chr.HumanoidRootPart.Position, chr.Target.Value.Parent.HumanoidRootPart.Position))
until
script.Parent.Walking.Value == false
end
end)
(Walking in that script is basically just a value to check if the boss is locked onto something)
I’d just take a distance tracking script to figure out your locking on and such.
And that’s all it took.
If you want to make the speed of the bullet more consistent use the plr:DistanceFromCharacter and do some division from there to get a constant speed for every shot, for me it’s not all that important so I’m just ignoring it.