NoUnderwaterRagdoll
Key Required

NoUnderwaterRagdoll

Draw A Raft & Set Sailmcdaggittmcdaggitt 663 views 14 executesUpdated Jan 29, 2026
0.0/ 5(1 votes)
010% Positive
Lua Script•37 lines (1480 chars)
local person = game.Players.LocalPlayer
local body = person.Character
local humanoidr = body:WaitForChild("HumanoidRootPart")
local humanoidp = body:WaitForChild("Humanoid")

local folder = workspace:FindFirstChild(person.Name)
if folder then
    local uw = folder:FindFirstChild("UnderwaterDetection")
    if uw then uw:Destroy() end
end

local ocean = workspace:FindFirstChild("OceanTile1")
local wavemath = require(game.ReplicatedStorage.WaveMath)
local floatForce
local function keepAboveWater()
    local pos = humanoidr.Position
    local waveY = ocean.Position.Y + math.abs(ocean.Position.Y) + wavemath.GetPosition(pos.X,pos.Z,workspace:GetServerTimeNow()).Y
    if pos.Y < waveY then
        if not floatForce then
            floatForce = Instance.new("VectorForce")
            floatForce.Name = "floatForce"
            floatForce.Attachment0 = humanoidr.RootAttachment
            floatForce.RelativeTo = Enum.ActuatorRelativeTo.World
            floatForce.Parent = humanoidr
        end
        local mass = humanoidr.AssemblyMass
        floatForce.Force = Vector3.new(0, math.clamp(mass*150*(waveY-pos.Y),0,mass*2000),0)
        humanoidp:ChangeState(Enum.HumanoidStateType.GettingUp)
    elseif floatForce then
        floatForce:Destroy()
        floatForce = nil
    end
end
game:GetService("RunService").Heartbeat:Connect(keepAboveWater)
body:WaitForChild("IsRagdoll").Changed:Connect(function()
    humanoidp:ChangeState(Enum.HumanoidStateType.GettingUp)
end)

Features & Information

Prevents you from ragdolling when hitting the water

Community Comments (0)

No comments yet for this script.

More Scripts for Draw A Raft & Set Sail