Okay so why does the script just skip the animation part and not do it while running the rest of the code, and how can I get the animation bit to work. One more thing, how do I make it so that the two parts that I clone into the workspace don’t vanish from the replicated storage because I want to use them again.
local rs = game:GetService("ReplicatedStorage")
local remote = rs.RemoteEvent
local player = game:GetService("Players")
remote.OnServerEvent:Connect(function(player)
local char = player.Character
local hum = char:WaitForChild("Humanoid")
local humrp = char:FindFirstChild("HumanoidRootPart")
local parteffect = rs.Effects.Particlewow
local shock = rs.Effects["Particle shock"]
local track = Instance.new("Animation")
track.AnimationId = "rbxassetid://17041413239"
local Anim = hum:LoadAnimation(track)
Anim:play()
parteffect:Clone()
parteffect.Parent = workspace
parteffect.Anchored = true
parteffect.CFrame = humrp.CFrame
parteffect.Orientation = humrp.Orientation
game.Debris:AddItem(parteffect, 5)
shock:Clone()
shock.Parent = workspace
shock.Anchored = true
shock.CFrame = humrp.CFrame + Vector3.new(-10,0,0)
shock.Orientation = humrp.Orientation
game.Debris:AddItem(shock, 5)
shock.Attachment.ParticleEmitter:Emit(300)
end)