I made an ability that creates a beam and damages the player but instead of 35 dmg it kills them.
Here is the Code:
local remote = game.ReplicatedStorage.BarrierBeam
remote.OnServerEvent:Connect(function(plr,mouseaim)
local parts = game.ServerStorage.Classes.BarrierMaster
local BeamLoc = parts.BarrierBeam
local Beam = BeamLoc:Clone()
Beam.Parent = workspace
Beam.CFrame = CFrame.new(mouseaim)
local dmg = game.Workspace.BarrierBeam.Damagepart
game.Debris:AddItem(Beam, 1.7)
wait(1.5)
dmg.Transparency = 0.6
dmg.Touched:Connect(function(hit)
for i,v in pairs(workspace:GetChildren()) do
local Debounce = false
if hit.Parent:FindFirstChild("Humanoid")and Debounce == false and hit.Parent.Name ~= plr.Name then
Debounce = true
hit.Parent.Humanoid:TakeDamage(35)
wait(2)
Debounce = false
end
end
end)
end)

1 comment
ty