Moves not working the first use?

so i made this kikoho script

the first time anybody uses it, it turns out like this:

of course this isn’t the excepted result. but the second time anybody uses it, it turns out like this:

everything functions as normal, it’s just most particles and sound just doesn’t load the first time

if you need the script i will give

We can’t help you If you don’t give us the script, just showing us the problem will not help, if you could provide the script then we would be able to help you

sorry.

client-side

local UIS = game:GetService("UserInputService")

local CAS = game:GetService("ContextActionService")

local remote = script.kikhoufired

local cd = true


local PlayerModule = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule"))

local Controls = PlayerModule:GetControls()

Controls:Disable()

wait(0.05)

Controls:Enable()

local hum = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")


cd = false

function firekikoho(actname, inputstate, inputobject)
	if actname == "KIKOHO" and inputstate == Enum.UserInputState.Begin then
		if cd == false then 
			Controls:Disable()
			cd = true
			remote:FireServer("InputPut")
		end
	end
end

CAS:BindAction("KIKOHO", firekikoho, true, Enum.KeyCode.H)

local kikohobutton = CAS:GetButton("KIKOHO")

if kikohobutton  then
	kikohobutton.Size = UDim2.new(0.3, 0, 0.3, 0)
	kikohobutton.Position = UDim2.new(0.25, 0, 0.15, 0)
	CAS:SetTitle("KIKOHO", "KIKOHO!!!!")
end


remote.OnClientEvent:Connect(function(any)
	if any == "AnimationDone" then
		Controls:Enable()
		wait(2)
		cd = false
	end
end)

serverside

local remote = script.Parent.kikhoufired
local animation = script.kikoho

remote.OnServerEvent:Connect(function(player, any)
	if any == "InputPut" then
		local hum = player.Character:FindFirstChildOfClass("Humanoid")
		local HRP:Part = player.Character:FindFirstChild("HumanoidRootPart")
		local playtrack = hum:FindFirstChildOfClass("Animator"):LoadAnimation(animation)
		hum.AutoRotate= false

		local alreadytouched = {}

		local thud = script.thud:Clone()
		thud.Parent = HRP
		local shift = script.shift:Clone()
		shift.Parent = HRP
		local step = script.step:Clone()
		step.Parent = HRP
		local transform = script.transform:Clone()
		transform.Parent = HRP
		local beam = script.beam:Clone()
		beam.Parent = HRP
		local ssj = script.sparking:Clone()
		ssj.Parent = HRP
		local charge = script.chargeup:Clone()
		charge.Parent = HRP
		local fire = script.fire:Clone()
		fire.Parent = HRP
		local shinkikoho = script.shinkikoho:Clone()
		shinkikoho.Parent = HRP



		playtrack:Play()



		local attach1 = Instance.new("Attachment")
		attach1.Parent = HRP
		attach1.Position = Vector3.new(0, -2.85, 0)
		local attach2 = Instance.new("Attachment")
		attach2.Parent = HRP
		attach2.Position = Vector3.new(0, 1.35, 0)
		local attach3 = HRP:FindFirstChild("RootAttachment")

		local sayianaura = script["0, 1.35, 0"].sayianaura:Clone()
		local glowups = script["0, -2.85, 0"].glow:Clone()
		local blastpart = script.rootpartattach.blastparticle:Clone()
		local light1 = script.rootpartattach.lightningone:Clone()
		local light2 = script.rootpartattach.ligthtning2:Clone()
		local spark = script.rootpartattach.spark:Clone()

		sayianaura.Parent = attach2
		glowups.Parent = attach1
		blastpart.Parent = attach3
		light1.Parent = attach3
		light2.Parent = attach3
		spark.Parent = attach3

		task.spawn(function()
			playtrack:GetMarkerReachedSignal("step"):Connect(function()
				step:Play()
				transform:Play()
				sayianaura.Enabled = true
				glowups.Enabled = true
				task.wait(0.2)
				ssj:Play()
			end)
			playtrack:GetMarkerReachedSignal("thud"):Connect(function()
				thud:Play()
				charge:Play()
				shinkikoho:Play()
				light1.Enabled = true
				light2.Enabled = true
			end)
			playtrack:GetMarkerReachedSignal("shift"):Connect(function()
				shift:Play()
				spark:Emit(1)
				playtrack:GetMarkerReachedSignal("fire"):Wait()
				shift:Stop()
			end)

			playtrack:GetMarkerReachedSignal("fire"):Connect(function()
				HRP = player.Character:FindFirstChild("HumanoidRootPart")
				local hrpcframe = HRP.CFrame 

				blastpart.Enabled = true
				task.spawn(function()
					beam:Play()
					fire:Play()
					charge:Stop()

					local ts = game:GetService("TweenService")

					local info = TweenInfo.new(0.75, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, 0, false, 0)
					task.spawn(function()
						local info2 = TweenInfo.new(1, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut, 0, false, 0.2)
						ts:Create(beam, info, {
							Volume = 0
						}):Play()
					end)

					local clone = game.ReplicatedStorage.effectsforpowers.blastki:Clone()
					clone.Parent = workspace
					clone.CFrame = hrpcframe 
						* CFrame.fromEulerAngles(math.rad(-90), hrpcframe.LookVector.Y, 0)
						* CFrame.new(0, 83.5, 1)
					
					local hitbox = game.ReplicatedStorage.effectsforpowers.kikohitbox:Clone()
					hitbox.Parent = workspace
					hitbox.CFrame = hrpcframe 
						* CFrame.fromEulerAngles(math.rad(-90), hrpcframe.LookVector.Y, 0)
						* CFrame.new(0, 83.5, 1)
					
					task.spawn(function()

						hitbox.Touched:Connect(function(other)
							if other and other.Parent:FindFirstChildOfClass("Humanoid") then
								if other.Parent.Name == "rat" or other.Parent.Name == "homeless" then
									if not table.find(alreadytouched, other.Parent) then
										table.insert(alreadytouched, other.Parent)
										local hum = other.Parent:FindFirstChildOfClass("Humanoid")
										task.spawn(function()
											for i = 1, 100 do
												hum.Health -= 2
												task.wait()
											end
										end)

										local otherhrp:Part = other.Parent:FindFirstChild("HumanoidRootPart")
										hum.Sit = true
										otherhrp:ApplyImpulse((player.Character.PrimaryPart.CFrame.LookVector + Vector3.new(0, 0.1, 0)) * 2000)
									end
								elseif game.Players:GetPlayerFromCharacter(other.Parent) and game.Players:GetPlayerFromCharacter(other.Parent) ~= player then
									if not table.find(alreadytouched, other.Parent) then
										table.insert(alreadytouched, other.Parent)
										local hum = other.Parent:FindFirstChildOfClass("Humanoid")
										local otherhrp:Part = other.Parent:FindFirstChild("HumanoidRootPart")
										hum.Sit = true
										local effectremote = game.ReplicatedStorage.effectsforpowers.kikoho
										effectremote:FireClient(game.Players:GetPlayerFromCharacter(other.Parent), player.Character.PrimaryPart.CFrame.LookVector)
									end
								end
							end
						end)
						wait(0.25)
						hitbox:Destroy()
					end)

					local blastween = ts:Create(clone, info,{
						["Size"] = Vector3.new(0.0001, clone.Size.Y, 0.0001)
					})
					blastween:Play()
					blastween.Completed:Wait()
					blastpart:Destroy()
					clone:Destroy()
				end)

				local TS = game:GetService("TweenService")
				local info = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)

				local rotation = 0

				for i = 1, 20 do
					task.wait()
					local clone = game.ReplicatedStorage.effectsforpowers.kirings:Clone()
					clone.CFrame = hrpcframe - Vector3.new(0, 0, hrpcframe.LookVector.Z)
					clone.Parent = workspace
					clone.Rotation += Vector3.new(0, 0, rotation)
					rotation += 25
					task.spawn(function()
						local targetPosition = clone.Position + clone.CFrame.LookVector * 250
						local tween = TS:Create(clone, info, { Position = targetPosition })
						tween:Play()
						wait(2)
						clone:Destroy()
					end)
				end


			end)
		end)

		wait(playtrack.Length)

		alreadytouched = {}
		
		attach1:Destroy()
		attach2:Destroy()
		
		sayianaura:Destroy()
		spark:Destroy()
		light1:Destroy()
		light2:Destroy()
		glowups:Destroy()

		ssj:Destroy()
		step:Destroy()
		thud:Destroy()
		shift:Destroy()
		beam:Destroy()
		transform:Destroy()
		charge:Destroy()
		task.spawn(function()
			fire.Ended:Wait()
			fire:Destroy()
		end)
		task.spawn(function()
			shinkikoho.Ended:Wait()
			shinkikoho:Destroy()
		end)

		remote:FireClient(player, "AnimationDone")
		hum.AutoRotate= true
	end
end)

I’m not too sure how that works, however what you should try putting a lot of prints and then fire the script twice, then you will be able to compare which prints haven’t activated and you will know where the problem is