#This script works but it kinda stops and has a little lag if u feel me

1 messages · Page 1 of 1 (latest)

harsh oxide
#

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)

outer pollen
#

Generated by chatgpt

harsh oxide
#

thats why

harsh oxide
outer pollen
#

Prob because the animation is server sided

rough creek
rough creek
#

You can send positional and rotational information from the client to the server and compare it against the server's version to verify it to then use it as the position to interpolate to

#

By doing that and maybe also accounting for velocity direction you can make it very smooth and feel seamless

rough creek
# harsh oxide so how can i fix it?

Or if you don't wanna do allat you could take the server location and estimate where you'll be in the next few frames and interpolate yourself there