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