I want to create a script when a player pumps a certain amount of power and after that he gets different energy punch
if power == "energy punch" then
if not game.Workspace:FindFirstChild(player.Name.."'s Energy Blast") then
local punch = game.ServerStorage.Powers.EnergyPunch:Clone()
punch.CFrame = character.HumanoidRootPart.CFrame
punch.Name = player.Name.."'s Energy Blast"
punch.Parent = game.Workspace
local antiGrav = Instance.new("BodyForce")
antiGrav.Force = Vector3.new(0, workspace.Gravity * punch:GetMass(), 0)
antiGrav.Parent = punch
punch.Velocity = CFrame.new(player.Character.HumanoidRootPart.Position, mouse).lookVector * 450
if not player.Safe.Value then
punch.Touched:Connect(function(hit)
local DMG = player.Strength.Value + 1
if hit.Parent ~= character and game.Players:GetPlayerFromCharacter(hit.Parent) then
TakeDamage:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent), player)
local tag = Instance.new("ObjectValue")
tag.Value = player
tag.Name = "creator"
tag.Parent = hit.Parent.Humanoid
game:GetService("Debris"):AddItem(tag, 0.5)
script.Disabled = true
wait(0.1)
script.Disabled = false
end
end)
end
Debris:AddItem(punch, 1.3)
end
end