I don't know if my code is incomplete or it's just not it I shoot and it won't shoot any bullet do I need some CFrame or different properties please help me?
--Made By johndeer2233
player = game.Players.LocalPlayer
mouse = player:GetMouse()
tool = script.Parent
AnimationIdle = script:WaitForChild("IdleGun")
idleenabled = true
enabled = true
ChamberGun = script.Parent.ChamberGun
--All the Animations
script.Parent.Equipped:connect(function()
if enabled then
enabled = false
local AnimationTrackIdle = player.Character.Humanoid:LoadAnimation(script.IdleGun)
AnimationTrackIdle:Play()
print("It Worked!")
end
wait(5)
enabled = true
end)
-- When SHooting
mouse.Button1Down:connect(function()
local bullet = Instance.new("Part")
bullet.Shape = "Ball"
bullet.Size = Vector3.new(0.6, 0.6, 0.6)
bullet.BrickColor = BrickColor.new("Medium Stone Grey")
bullet.Position = ChamberGun.Position
bullet.Velocity = Vector3.new(-100,0,0)
bullet.Parent = ChamberGun
end)
There is no error in the output and the chamber gun position is the end of the gun and different part as well as it is set to CanCollide = false

1 comment
You're not setting where to Exactly to Shoot at.