Greetings. So basically I was making a reversal red (an explosion type of technique btw) and when I use it the enemy npc flys to the direction, but only that direction. I want the npc to be able to go in all directions for example, I am behind the npc, I want it to go flying the opposite direction like it goes for flying far behing me if you get what Im saying heres a vid
robloxapp-20240403-0302575.wmv (4.2 MB)
Heres the script too
Hitbox.Touched:Connect(function(hit)
if (debounce) then
return
end
if hit.Parent ~= character and hit.Parent:FindFirstChild("Humanoid") then
local echar = hit.Parent
local ehum = echar:WaitForChild("Humanoid")
local ehumrp = echar:WaitForChild("HumanoidRootPart")
debounce = true
task.wait(.85)
ehum.Health = ehum.Health - 10
debounce = false
local dir = (ehumrp.Position - humrp.Position).Unit
local bv = Instance.new("BodyVelocity",ehumrp)
bv.MaxForce = humrp.CFrame.LookVector * 2000
bv.Velocity = (dir + Vector3.new(0,1,1)).Unit * 100
bv.P = 500
game.Debris:AddItem(bv, .5)
ehum.PlatformStand = true
task.wait(2.5)
ehum.PlatformStand = false
Hitbox:Destroy()
end
end)
wait(.8)
local Effect = Explosion.Attachment.Spikes
Effect:Emit(40)
RocksModule.Ground(humrp.Position + Vector3.new(0,1,0), 17,Vector3.new(2,2.5,2),nil,20,false,1)
game.Debris:AddItem(Explosion,1)
Red:Destroy()
Hitbox:Destroy()
How do I change this and if anyone has experience with this, how do I make it better?