local Damage = 50
local HeadshotDamage = 100
script.Parent.FireEv.OnServerEvent:Connect(function(Player, Shooter, MousePos)
script.Parent.FirePart.Fire:Play()
local Bullet = Instance.new("Part", workspace)
Bullet.CFrame = script.Parent.FirePart.CFrame
Bullet.Orientation = Bullet.Orientation + Vector3.new(0, 90, 0)
Bullet.Size = Vector3.new(0.75, 0.15, 0.15)
Bullet.BrickColor = BrickColor.new("Bright yellow")
Bullet.TopSurface = "Smooth"
Bullet.BottomSurface = "Smooth"
Bullet.Material = "Neon"
Bullet.CanCollide = false
local BVol = Instance.new("BodyVelocity", Bullet)
BVol.P = 100
Bvol.Velocity = MousePos
local I = 0
while I > 100 do
Bullet.Touched:Connect(function(Toucher)
if Toucher.Parent == Shooter then return end
local Hum = Toucher.Parent.Humanoid
if not Hum then return end
if Toucher.Name == "Head" then
Hum:TakeDamage(HeadshotDamage)
else
Hum:TakeDamage(Damage)
end
end)
I = I + 1
wait()
end
Bullet:Destroy()
end)
I'm using BodyVelocity (I know it's bad but it's what I know for now) to move the bullet around. When I try to fire it up, it simply continues pushing forwards instead of moving upwards. It seems to actually change its power depending on where the mouse is. How can I fix this mistake?
