script.Attack1.OnServerEvent:Connect(function(player, mouse)
local marked = {}
table.clear(marked)
local touched = true
touched = false
local Hitbox = Instance.new(“Part”, workspace)
game.Debris:AddItem(Hitbox, 2)
Hitbox.Transparency = 0
Hitbox.Material = Enum.Material.Neon
Hitbox.Shape = “Cylinder”
Hitbox.CastShadow = false
local rcol = math.random(1,2)
if rcol == 1 then Hitbox.BrickColor = BrickColor.new(“Lime green”) end
if rcol == 2 then Hitbox.BrickColor = BrickColor.new(“Black”) end
Hitbox.Size = Vector3.new(100, 5, 5)
Hitbox.Position = mouse
Hitbox.Orientation = Vector3.new(0,0,90)
CFrame.Angles(0,0,math.rad(90)) + parent.HumanoidRootPart.CFrame.lookVector * 30
Hitbox.Anchored = true
Hitbox.CanCollide = false
local TweenService = game:GetService(“TweenService”)
local goal = {}
goal.Size = Vector3.new(100, 10, 10)
goal.Transparency = 1
local tweenInfo = TweenInfo.new(2)
local tween = TweenService:Create(Hitbox, tweenInfo, goal)
tween:Play()
Hitbox.Touched:Connect(function(Hit)
if touched == false then
if table.find(marked, Hit.Parent, 1) then return end
if Hit.Parent == parent then return end
if not Hit or not Hit.Parent or not string.find(string.lower(Hit.name),“torso”) then return end
if not Hit.Parent:FindFirstChild(“Humanoid”) then return end
if Hit.Parent.ClassName == “Tool” then return end
local humanoid = Hit.Parent:FindFirstChild(“Humanoid”)
tagHumanoid(humanoid, vPlayer)
if not Hit.Parent:FindFirstChild(“Counter”) then
Hit.Parent.Humanoid:TakeDamage(10)
table.insert(marked, Hit.Parent)
wait(1)
untagHumanoid(humanoid)
return end
if Hit.Parent:FindFirstChild(“Counter”).Value == true then
table.insert(marked, Hit.Parent)
game.ServerStorage.GiveExp:Fire(10, humanoid.creator.Value)
wait(1)
untagHumanoid(humanoid)
return end
table.insert(marked, Hit.Parent, 1)
Hit.Parent.Humanoid:TakeDamage(10)
wait(1)
untagHumanoid(humanoid)
end
end)
wait(0.1)
print(marked)
touched = true
end)
pretty messy code