kind of self explanatory
local player = game.Players.LocalPlayer local Mouse = player:GetMouse() game:GetService("UserInputService").InputBegan:connect(function(input,proc) if input.KeyCode == Enum.KeyCode.N then script.Disabled = true local anim = Instance.new("Animation") anim.AnimationId = 'rbxassetid://865973063' local loadanim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(anim) loadanim:Play() local x = Instance.new("Part", workspace) x.Anchored = false x.CanCollide = false x.Material = "Neon" x.Transparency = 1 x.Size = Vector3.new(2.5,2.5,2.5) x.BrickColor = BrickColor.new("Cyan") x.CFrame = player.Character.RightHand.CFrame*CFrame.new(0,0,0) local weld = Instance.new("Weld", x) weld.Part0 = x weld.Part1 = game.Players.LocalPlayer.Character["RightHand"] local aa = script.particle1:Clone() aa.Parent = x game.Debris:AddItem(x,0.8) x.Touched:connect(function(Hit) if Hit.Parent:FindFirstChild("Humanoid") and Hit.Parent.Humanoid ~= player.Character.Humanoid then Hit.Parent.Humanoid:TakeDamage(16) end end ) wait(3) script.Disabled = false end end )
If you want it only damage once, and only once and never again. You can create a variable so that it will only damage once. Since your script is pretty long, I will show my example;
local hit = 0 -- the variable you need local p =script.Parent p.Touched:Connect(function(H) if hit = 0 then -- only works if hit is 0 hit = 1 -- hit becomes 1 so it won't damage again -- Do damage script end end)
if you want the ball to do damage again then just make hit = 0 again at the end or leave it as 1 forever and it will never do damage EVER again.
Good Luck and Have Fun developing!