I would like to replicate the animation on the server just like how it is on the client. However, it is bugging out.
Here is the code.
Mouse.Button2Down:connect(function()
if equipped == true then
debounce = false
aiming = true
if aimdebounce == false then
aimanimation:AdjustSpeed(1)
aimanimation:Play()
end
game.ReplicatedStorage.gunsystem.cameraswitch:Fire(ignore, true)
wait(.7)
while aiming do
aimdebounce = true
aimanimation:AdjustSpeed(0)
wait()
end
end
end)
Mouse.Button2Up:connect(function()
if aimdebounce == true then
shootanimation:AdjustSpeed(1)
shootanimation.TimePosition = 0
shootanimation:Stop()
aimanimation:AdjustSpeed(1)
aimanimation.TimePosition = 0
aimanimation:Stop()
debounce = true
aiming = false
shooting = false
aimdebounce = false
debounce1 = true
game.ReplicatedStorage.gunsystem.cameraswitch:Fire(e, false)
end
end)
aimanimation.Stopped:Connect(function()
if debounce == false then
aimanimation:Play()
aimanimation:AdjustSpeed(0)
aimanimation.TimePosition = aimanimation.Length
end
end)
Client sided:
Server sided: