Tween of shaking a model on the server is not replicating onto the client.
(video was too big)
Video: Kapwing — Create more content in less time
--shake function; connected to base.Humanoid.HealthChanged
local cycleDuration = 0.05
local totalDuration = 0.1
local volatility = .5
function npcModule.shakeBase(base)
local randomMove = Vector3.new(math.random(),0,math.random()).Unit
local shakeLeft = 0
for i, part in pairs(base.ShakeParts:GetDescendants()) do
if part:IsA("BasePart") then
coroutine.wrap(function()
shakeLeft += 1
local savedPosition = part.Position
local tweeninfo = TweenInfo.new(
cycleDuration,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
for i = 0, totalDuration - cycleDuration, cycleDuration do
local tween = TS:Create(
part,
tweeninfo,
{Position = savedPosition + randomMove * volatility}
)
tween:Play()
tween.Completed:Wait()
end
TS:Create(
part,
tweeninfo,
{Position = savedPosition}
):Play()
shakeLeft -= 1
end)()
end
end
repeat task.wait() until shakeLeft == 0
end
I want to make it so it also shows up on the client. The tween is happening server side.