I made a script, when you click, it shoots a bullet. Unfortunately, the bullet only goes on the Z axis, not the Z axis relevant to the gun! Why is that happening? Here is my script
wait(1)
script.Parent.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function()
-- local animation = script.Slash
-- local plyr = script.Parent.Parent.Name
-- local char = workspace:FindFirstChild(plyr)
-- local anim = char.Humanoid:LoadAnimation(animation)
-- anim:Play()
local bullet = Instance.new("Part")
bullet.FormFactor = "Custom"
bullet.Size = Vector3.new(0.5,0.2,0.2)
bullet.BrickColor = BrickColor.new("Toothpaste")
bullet.BackSurface = "SmoothNoOutlines"
bullet.BottomSurface = "SmoothNoOutlines"
bullet.FrontSurface = "SmoothNoOutlines"
bullet.LeftSurface = "SmoothNoOutlines"
bullet.RightSurface = "SmoothNoOutlines"
bullet.TopSurface = "SmoothNoOutlines"
bullet.Velocity = Vector3.new(0,0,100)
bullet.Parent = workspace
bullet.Position = script.Parent.Handle.Position
bullet.Transparency = 0
bullet.CanCollide = true
--local speed = script.Speed:clone()
--speed.Parent = bullet
local damage = script.DamageScript:clone()
damage.Parent = bullet
print("HALLAAA")
end)
end)
Please help!!! Thank you!!!

1 comment
Sorry, didn't see your answer.