local RS = game:GetService("ReplicatedStorage")
local event = RS:WaitForChild("QuakeEvent")
event.OnServerEvent:Connect(function(player, camCFrame)
local char = player.Character
if not char then return end
local hum = char:FindFirstChild("Humanoid")
local root = char:FindFirstChild("HumanoidRootPart")
if not hum or not root then return end
local oldWalk = hum.WalkSpeed
local oldJump = hum.JumpPower
local freezePos = root.CFrame
hum.WalkSpeed = 0
hum.JumpPower = 0
root.Anchored = true
root.Velocity = Vector3.new(0,0,0)
root.RotVelocity = Vector3.new(0,0,0)
root.CFrame = freezePos
local look = camCFrame.LookVector
root.CFrame = CFrame.new(root.Position, root.Position + look)
local animObj = RS:FindFirstChild("QuakePunchAnim")
local track = hum:LoadAnimation(animObj)
track:Play()
track.Ended:Connect(function()
root.Anchored = false
hum.WalkSpeed = oldWalk
hum.JumpPower = oldJump
end)
local range = 25
local damage = 20
local force = 80
for _, model in ipairs(workspace:GetDescendants()) do
if model:FindFirstChild("Humanoid") and model ~= char then
local hrp = model:FindFirstChild("HumanoidRootPart")
if hrp then
local dist = (hrp.Position - root.Position).Magnitude
if dist <= range then
model.Humanoid:TakeDamage(damage)
local dir = (hrp.Position - root.Position).Unit
hrp.Velocity = dir * force
end
end
end
end
end)