The script works , it spawns a part but the velocity script isn't working for some reason??
local ray = Ray.new(script.Parent.Position,Vector3.new(0,0,-40))
local Peashooter = script.Parent.Parent
local Damage = 20
local Folder = workspace.Folder
local main = script.Parent
local Debris = game:GetService("Debris")
local plr = game.Players
while wait(2.5)do
local hit,position = workspace:FindPartOnRayWithIgnoreList(ray,{script.Parent,Folder})
if hit then
local k = Instance.new("Part", game.workspace)
k.Anchored = false
k.CFrame = main.CFrame + Vector3.new(0,0,0)
k.Size = Vector3.new(1,1,1)
k.Shape = "Ball"
k.BrickColor = BrickColor.new("Bright green")
k.Material = "Neon"
k.Parent = Folder
k.CanCollide = false
k.Velocity = main.CFrame.LookVector * (hit.Position - main.Position).Magnitude
Debris:AddItem(k,5.5)
k.Touched:Connect(function(hit)
local Enemy = hit.Parent.Zombie
Enemy:TakeDamage(Damage)
k:Destroy()
end)
end
end

2 comments
Add in print(tostring(main.CFrame.LookVector * (hit.Position - main.Position).Magnitude)) on line 24 and tell me what you get
It doesn't print anythign ..?