I am currently working on a afterimage effect which is triggered through the client. But I want it to be replicated through the server.
But when I use it on the server it’s not synced correctly. But when I run it in the client, nobody can see it except me.
Any help?
Here is a video of it.
Server Code:
elseif (v == 'Accelerator') then
local WalkAnim = char.Animate.walk.WalkAnim
local RunAnim = char.Animate.run.RunAnim
local AnimationTracks = Animator:GetPlayingAnimationTracks()
for i, track in pairs (AnimationTracks) do track:Stop() end
WalkAnim.AnimationId = "rbxassetid://8796383264"
RunAnim.AnimationId = "rbxassetid://8796383264"
ability:FireClient(player, 2)
hum.WalkSpeed = 60
end
Client Code:
ability.OnClientEvent:Connect(function(v)
if (v == 2) then
local connect
connect = RunService.Heartbeat:Connect(function()
for i,v in pairs(char:GetChildren()) do
if (v:IsA('BasePart')) then
local Shadow = v:Clone()
Shadow:ClearAllChildren()
if (v.Name == 'Head') then
local HeadShape = Instance.new('SpecialMesh')
HeadShape.MeshType = Enum.MeshType.Head
HeadShape.Scale = Vector3.new(1.25, 1.25, 1.25)
HeadShape.Parent = Shadow
end
Shadow.CFrame = char:FindFirstChild(Shadow.Name).CFrame
Shadow.Color = Color3.fromRGB(170, 6, 235)
Shadow.CanCollide = false
Shadow.Anchored = true
Shadow.Parent = workspace.Assets.VFX
TweenService:Create(Shadow, TweenInfo.new(0.1), {Transparency = 1}):Play()
Debris:AddItem(Shadow, 0.3)
end
end
end)
end
end)
If there is any alternatives, it would be appreciated to see any.