I need some assistance with this script

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)
	
	

For the animation, I don’t remember but perhaps the syntax requires the P in Play() to be capital, I’ll look further into it.

But for the cloning, you aren’t creating a variable for the clone. You are instead making a clone, then editing the original part, which could mess up the script. Instead make a variable for the clone, and manipulate that instead.

And also, perhaps the animation priority isn’t set high enough?
You can change this inside the animation editor.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.