Whenever the player is walking while shooting this is what happens:
robloxapp-20221221-2326511.wmv (1.4 MB)
local function shoot()
if Reloading then
return
end
if Ammo.Value > 0 then
local char = player.Character or player.CharacterAdded:Wait()
local Shoot = char:WaitForChild("Humanoid"):LoadAnimation(Shoot)
Ammo.Value -= 1
local bulletDrop = Instance.new("Part")
bulletDrop.Name = "bulletDrop"
bulletDrop.BrickColor = BrickColor.new("Gold")
bulletDrop.Size = Vector3.new(0.3, 0.1, 0.1)
bulletDrop.CanCollide = false
bulletDrop.Anchored = true
bulletDrop.Parent = workspace
bulletDrop.CFrame = Gun.Bullets.CFrame
bulletDrop.Anchored = false
game:GetService("Debris"):AddItem(bulletDrop, 1)
Shoot:Play()
if not newGun.Automatic then
UseScope = false
scope()
end
Gun:FindFirstChild("ShootParticle", true):Emit(1)
Client_Server:FireServer("GunServer", newGun, mouse.Hit.p)
local function returnRecoil(RAD, DontComplete)
do
local tween = TweenService:Create(
camera,
TweenInfo.new(0.05),
{ CFrame = camera.CFrame * CFrame.Angles(math.rad(RAD), 0, 0) }
)
tween:Play()
if DontComplete then
tween.Completed:Wait()
end
end
end
--returnRecoil(10)
-- task.wait(.05)
-- returnRecoil(-10,true)
--returnRecoil(5)
if newGun.Automatic then
camera.CFrame *= CFrame.Angles(math.rad(2.5), 0, 0)
else
camera.CFrame = camera.CFrame * CFrame.Angles(math.rad(10),0,0)
task.wait(.05)
TweenService:Create(
camera,
TweenInfo.new(.15),
{CFrame = camera.CFrame * CFrame.Angles(math.rad(-10),0,0)}
):Play()
-- camera.CFrame *= CFrame.Angles(
-- math.rad(camera.CFrame.X),
-- math.rad(camera.CFrame.Y) + math.rad(10),
-- math.rad(camera.CFrame.Z)
-- )
-- task.wait(1)
-- camera.CFrame = CFrame.Angles(math.rad(camera.CFrame.X),math.rad(camera.CFrame.Y) - math.rad(10), math.rad(camera.CFrame.Z))
end
else
UseScope = false
scope()
reload()
end
end
I think the main issue is around the recoil maybe?