Part wont clone for every player with remote event

Im making this boost of power move, and for some reason the parts wont clone for every player that activates the move, even though i put the clone in a variable under OnServerEvent

Code
local event = game.ReplicatedStorage.Events.KEvents:WaitForChild("Move 3")
local bool = false
local TS = game:GetService("TweenService")

local debris = game:GetService("Debris")
local db = false
local cooldown = false
local CD = false

local armL = game.Lighting["Game Assets"]:WaitForChild("Kindness Assets"):WaitForChild("Left Arm Aura"):Clone()
local armR = game.Lighting["Game Assets"]:WaitForChild("Kindness Assets"):WaitForChild("Right Arm Aura"):Clone()

event.OnServerEvent:Connect(function(plr)
	if bool == false then
		bool = true
		-------------------------------------
		--Variables and instance configuration
		local lArm = armL:Clone()
		local rArm = armR:Clone()
		local char = plr.Character or plr.CharacterAdded:Wait()
		
		
		local weld1 = Instance.new("Weld")
		local weld2 = Instance.new("Weld")
		local cLeft = char:WaitForChild("Left Arm")
		
		local cRight = char:WaitForChild("Right Arm")
		local value = Instance.new("BoolValue")		
		local rootPart = char:WaitForChild("HumanoidRootPart")
		value.Name = "More Damage"
		-------------------
		lArm.Parent = char
		rArm.Parent = char
		
		weld1.Parent = char
		weld2.Parent = char
		-------------------
		weld1.Part0 = cLeft
		weld1.Part1 = lArm
		
		weld2.Part0 = cRight
		weld2.Part1 = rArm
		-------------------------------------
		lArm.Touched:Connect(function(hit)
			if cooldown == false then
				cooldown = true
				if not hit.Parent:IsA("Model") and hit.Parent:WaitForChild("Humanoid") then return end

				local hum = hit.Parent:WaitForChild("Humanoid")
				-------------------------------------
				local animation = Instance.new("Animation")

				animation.AnimationId = "rbxassetid://8301711826"
				local track = hum:LoadAnimation(animation)
				-------------------------------------
				--Tweening
				local Speed = 50
				local Force = 8000000

				local TotalForce = Force

				local KnockBack = Instance.new("BodyVelocity")

				KnockBack.MaxForce = Vector3.new(TotalForce,TotalForce,TotalForce)
				KnockBack.Velocity = char:FindFirstChild("HumanoidRootPart").CFrame.LookVector * Speed 

				-------------------------------------
				if hit.Parent:IsA("Model") and hit.Parent:WaitForChild("Humanoid") then
					value.Parent = hit.Parent
					----------------------------------------
					if value.Parent == hit.Parent then
						if CD == false then
							CD = true
							hum.WalkSpeed = 0
							hum.JumpHeight = 0
							hum:TakeDamage(40)
							KnockBack.Parent = hit.Parent:FindFirstChild("HumanoidRootPart")--part is the target of the knockback/ the opponent
							-----------------------
							task.wait(1.5)
							-----------------------
							KnockBack:Destroy()
							hum.WalkSpeed = 16
							hum.JumpHeight = 7.2
							value:Destroy()
							wait(5)
							CD = false
						end
					end
				end
				wait(10)
				cooldown = false
			end
		end)
		
		rArm.Touched:Connect(function(hit)
				if cooldown == false then
					cooldown = true
					if not hit.Parent:IsA("Model") and hit.Parent:WaitForChild("Humanoid") then return end
					local hum = hit.Parent:WaitForChild("Humanoid")
					-------------------------------------
					local animation = Instance.new("Animation")

					animation.AnimationId = "rbxassetid://8301711826"
					local track = hum:LoadAnimation(animation)
					-------------------------------------
					--Tweening
					local Speed = 50
					local Force = 8000000

					local TotalForce = Force

					local KnockBack = Instance.new("BodyVelocity")

					KnockBack.MaxForce = Vector3.new(TotalForce,TotalForce,TotalForce)
					KnockBack.Velocity = char:FindFirstChild("HumanoidRootPart").CFrame.LookVector * Speed 

					-------------------------------------
					if hit.Parent:IsA("Model") and hit.Parent:WaitForChild("Humanoid") then
						value.Parent = hit.Parent
						----------------------------------------
						if value.Parent == hit.Parent then
							if CD == false then
								CD = true
								hum.WalkSpeed = 0
								hum.JumpHeight = 0
								hum:TakeDamage(40)
								KnockBack.Parent = hit.Parent:FindFirstChild("HumanoidRootPart")--part is the target of the knockback/ the opponent
								-----------------------
								task.wait(1.5)
								-----------------------
								KnockBack:Destroy()
								hum.WalkSpeed = 16
								hum.JumpHeight = 7.2
								value:Destroy()
								wait(5)
								CD = false
							end
						end
					end
					wait(10)
					cooldown = false
				end	
		end)
		-------------------------------------

		--Tweening
		local goal = {}
		goal.Transparency = 0.8
		
		local goal2 = {}
		goal2.Transparency = 1
		
		local tween1 = TS:Create(lArm, TweenInfo.new(1), goal)
		local tween2 = TS:Create(rArm, TweenInfo.new(1), goal)
		
		local tween3 = TS:Create(lArm, TweenInfo.new(1), goal2)
		local tween4 = TS:Create(rArm, TweenInfo.new(1), goal2)

		tween1:Play()
		tween2:Play()
		-------------------------------------
		wait(5)
		tween3:Play()
		tween4:Play()
		tween3.Completed:Wait()
		-------------------------------------
		lArm:Destroy()
		rArm:Destroy()
		bool = false
	end
end)

This is happenning with most of my combat moves. Help is appriechiated, thank you for your time :grinning:

2 Likes

Not sure if this is the problem but you’re cloning them twice, remove the :Clone() on lines 10 & 11

2 Likes

i removed the extra clones, but that still didnt solve the issue :sweat_smile:

2 Likes

The animations are running so does that mean that the arms touched the character?

1 Like

i’d assume so, yes. I still havent figured out the issue

1 Like

Try anchoring the arms after you weld them to see if the player is frozen. And then check through the explorer to see if it is actually in the character or not.

I just checked and the arms are inside the players character. Anchoring the arms wont do anything i believe

1 Like

Is the position of one of the arms even close the to actual arm?

Not entirely sure, but you have your main bools at the top of the script and several times through-out you disable/enable them, which in theory would prevent other players from also using the skill.
It could also be that your script overlaps a lot. Theres a lot of unneeded parts. Like for example the way youre handling damage and doing tweens. Damage could be made in 1 function. It also could be a problem with your client script.
Something I would suggest also is running a test server in studio to see if any errors occur. That would probably be the fastest way to figure out if an error is being thrown. Then you can fix it from there. You really should work on condensing your script though I can’t imagine something like this would be good on performance over time.

2 Likes

Thank you so much for the feedback!

could you give me an example of how i can put damage in a function? ive only been scripting for a few mnths now so im fairly new.

1 Like

Make sure you are setting the CFrame of the arms to the actual arm’s CFrame. Also, I have a suggestion, since not everyone has those cuboid arms, duplicate their arm and then go

Arm.Size = Arm.Size * 1.1

then rename and apply the effects you want to (Then of course set the CFrame and weld).

1 Like