I am confused why this script is duplicating this part too many times is there anyone who can help me with this
—Script----
local UIS = game:GetService("UserInputService")
local module = {}
local db = false
local ShockClone
local WeldConst
function module:Activate(Plr,Humanoid:Humanoid)
local Keycode = Enum.KeyCode.E
local Animation = script:FindFirstChild("Ice Barrage")
local Animator = Humanoid:FindFirstChildOfClass("Animator")
local Track = Animator:LoadAnimation(Animation)
local Char = Plr.Character or Plr.CharacterAdded:Wait()
UIS.InputBegan:Connect(function(inp,gpe)
if gpe then return end
if inp.KeyCode == Enum.KeyCode.E and not db then
db = true
Track:Play()
Track:GetMarkerReachedSignal("Blast"):Connect(function()
ShockClone = game.ReplicatedStorage.Shock:Clone()
WeldConst = Instance.new("WeldConstraint")
WeldConst.Parent = Char:WaitForChild("Right Arm")
ShockClone.Parent = workspace
ShockClone.CanCollide = false
ShockClone.Anchored = true
ShockClone.Position = Char:WaitForChild("Right Arm").Position
end)
Track.Ended:Connect(function()
ShockClone:Destroy()
task.wait(1)
db = false
end)
end
end)
end
return module