Quick actions

cmd+k|ctrl+k

Navigation

Languages

poseidon

Snippet info

Language

Lua

Visibility

public

Author

marelover69

Created

2025-07-21T16:01:28.700466Z

Updated

2025-07-23T20:44:21.950008Z


--[[


                       ####                       
                      #####*                      
                      ######                      
                     ########                     
                     ########                     
                    ##########                    
                   *##########                    
                   ############                   
                  *#############                  
 ################################################ 
##################################################
##################################################
  ##############################################  
    #########################################     
       ####################################       
         ###############################*         
            ##########################            
             ########################             
            #########################             
            ##########################            
           ###########################+           
           ############################           
          ##############  ##############          
          ###########        ###########          
         ##########            ##########         
         #######                  #######         
         #####                      #####         


  |  <========V=============================^=======>  |
  |  ---------<-------POSEIDON-------------->--------  |
  |  <========V=============================^=======>  |
]]

--[[
    (\ written by wreyking /)
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣌
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣮⣙⠿
⠀⠙⢿⣿⣿⣿⣿⣿⣯⡛⣛⠻⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄
⣧⣼⡷⠮⢍⣛⠿⣿⣿⣿⣮⣙⢿⣶⡎⢩⣭⡛⠻⢿⣿⣿⣿⣿⣿
⡟⢡⣶⣶⣶⣦⡉⠲⣬⣙⠻⠿⣷⣝⠧⠈⢿⡷⠹⣷⣶⣭⣽⣿⣿
⠀⣿⣿⣿⡟⠁⠀⠀⠈⢻⣿⣷⣶⣬⣥⣄⢘⣷⡀⣿⣿⣿⣿⣿⡀
⠀⣿⣿⣿⡽⣿⣷⡔⢷⡀⢻⣿⣿⠿⢿⠿⣧⣹⣿⣽⣿⣿⣿⣿⡇
⠚⣿⣿⣿⣷⣴⣿⣦⠘⣷⢸⡿⢥⣶⣿⣇⣼⢿⣿⣿⣿⣿⣿⣿⠀
⢷⡌⢿⣿⣿⣿⣿⣿⣷⣿⣿⣷⣤⣼⣿⣿⡟⡈⣿⣿⣿⣿⣿⡏⠀
⡊⢻⣄⠹⣿⣿⣿⣿⣿⣿⣿⣷⡈⠉⡛⠋⠀⠃⢹⣿⣿⣿⡿⢁⣾
⢟⠮⡻⣦⡈⢿⣿⣿⣿⣿⣿⣿⣿⣦⡈⠀⣴⡖⣸⣿⣿⡿⠀⢾⣿
⡈⢿⣦⣌⣳⣦⡈⠿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣴⣿⣿⣿⣷⣦⡀⠻
    (\ written by wreyking /)
--]]

--==[ CLIENT SCRIPT ]==--

--[ Services ]--

local ContextActionService = game:GetService("ContextActionService")
local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local RuS = game:GetService("RunService")
local CAS = game:GetService("ContextActionService")

--[ SB ]--

local scriptArgs = table.pack(...)
local debug = scriptArgs[1]

print(debug, scriptArgs, ...)

if not debug then
    print = function() end
    warn = function() end
end

--[ Variables ]--

local owner = Players.LocalPlayer
local storeInScript = (game.PlaceId == 15589112741)

local scriptName = "poseidon"
local serverScript = workspace:WaitForChild(scriptName.."/"..owner.Name)

local scriptRemote = ((storeInScript and serverScript) or RS):WaitForChild("ScriptRemote".."/"..owner.Name)
local scriptRemoteF = ((storeInScript and serverScript) or RS):WaitForChild("ScriptRemoteFunction".."/"..owner.Name)
local VFXFolder = ((storeInScript and serverScript) or workspace):WaitForChild("VFXFolder".."/"..owner.Name)
local ObjectsFolder = ((storeInScript and serverScript) or workspace):WaitForChild("ObjectsFolder".."/"..owner.Name)

local abilityData = {
    Aegis = {
        Keybind = Enum.KeyCode.Q,
        CD = 0.5,
    },
    Empyrean = {
        Keybind = Enum.KeyCode.E,
        CD = 0.1,
    },
    Jupiter = {
        Keybind = Enum.KeyCode.R,
        CD = 1,
        MaxHoldTime = 5,
    },
    Zephyr = {
        Keybind = Enum.KeyCode.F,
        CD = 1,
        RagdollTime = 5
    }
}

local toolName = "Poseidon_Tool"

local abilityVariables = {}
abilityVariables.OnCooldown = {}
abilityVariables.UsedMoves = {}
abilityVariables.MagicColor = Color3.new(0, 0, 0)
local usingMove = false
local moveBeingUsed = nil

--[ Functions ]--

local abilities
abilities = {
    Aegis = function(actionName, inputState, inputObject)
        if abilityVariables.OnCooldown[actionName] then warn(tostring(actionName).." is currently on cooldown") return end

        local char = owner.Character
        local root = char:FindFirstChild("HumanoidRootPart")
        local hum = char:FindFirstChildOfClass("Humanoid")

        local mouse = owner:GetMouse()
        mouse.TargetFilter = VFXFolder
        
        if inputState == Enum.UserInputState.Begin then
            if usingMove then return end
            if abilityVariables.UsedMoves[actionName] then return end
            if not char:FindFirstChild(toolName) then return end
            
            usingMove = true
            moveBeingUsed = actionName
            abilityVariables.UsedMoves[actionName] = tick()
            print(actionName.." on client")

            local rootAttachment = root:FindFirstChild("RootAttachment")

            -- Freeze character in place using AlignPosition
            local alignPosition = Instance.new("AlignPosition")
            alignPosition.Name = "FreezePosition"
            alignPosition.Attachment0 = rootAttachment
            alignPosition.Mode = Enum.PositionAlignmentMode.OneAttachment
            alignPosition.Position = root.Position
            alignPosition.MaxForce = 50000000000 -- Adjust force limits to match needs
            alignPosition.MaxVelocity = math.huge
            alignPosition.Responsiveness = 50
            alignPosition.ApplyAtCenterOfMass = true
            alignPosition.RigidityEnabled = false
            alignPosition.Parent = root

            -- Create AlignOrientation for smooth turning
            local alignOrientation = Instance.new("AlignOrientation")
            alignOrientation.Name = "TrackMouseOrientation"
            alignOrientation.Attachment0 = rootAttachment
            alignOrientation.Mode = Enum.OrientationAlignmentMode.OneAttachment
            alignOrientation.MaxTorque = 500000
            alignOrientation.Responsiveness = 50
            alignOrientation.Parent = root

            -- Switch humanoid to PlatformStand to disable default movement
            hum:ChangeState(Enum.HumanoidStateType.PlatformStanding)

            -- Loop to update facing direction
            task.spawn(function()
                while usingMove do
                    local targetPosition = mouse.Hit.Position
                    alignOrientation.CFrame = CFrame.lookAt(root.Position, targetPosition)
                    task.wait(0.01)
                end
            end)

            scriptRemote:FireServer(scriptName, actionName, "Begin")
            print("fired server: ", actionName)
            
        elseif inputState == Enum.UserInputState.End then
            if not abilityVariables.UsedMoves[actionName] then return end
            
            local alignPosition = root:FindFirstChild("FreezePosition")
            local alignOrientation = root:FindFirstChild("TrackMouseOrientation")

            task.delay(0.35, function()
                if alignPosition then alignPosition:Destroy() end
                if alignOrientation then alignOrientation:Destroy() end
                scriptRemote:FireServer(scriptName, actionName, "End")
            end)

            task.delay(0.35, function()
                usingMove = false
                moveBeingUsed = nil
                abilityVariables.UsedMoves[actionName] = nil
            end)
            
            abilityVariables.OnCooldown[actionName] = true
            task.delay(abilityData[actionName].CD, function()
                abilityVariables.OnCooldown[actionName] = nil
            end)
        end
    end,
    Empyrean = function(actionName, inputState, inputObject)
        if abilityVariables.OnCooldown[actionName] then warn(tostring(actionName).." is currently on cooldown") return end

        local char = owner.Character
        local root = char:FindFirstChild("HumanoidRootPart")
        local hum = char:FindFirstChildOfClass("Humanoid")
        
        if inputState == Enum.UserInputState.Begin then
            if usingMove then return end
            if abilityVariables.UsedMoves[actionName] then return end
            if not char:FindFirstChild(toolName) then return end
            
            usingMove = true
            moveBeingUsed = actionName
            abilityVariables.UsedMoves[actionName] = tick()
            print(actionName.." on client")

            local walkPartConnection
            walkPartConnection = RuS.Heartbeat:Connect(function()
                if not usingMove or not abilityVariables.UsedMoves[actionName] then
                    walkPartConnection:Disconnect()
                    walkPartConnection = nil
                end
                
                local walkPart = Instance.new("Part")
                walkPart.Name = "PoseidonWalkPart"
                walkPart.Anchored = true
                walkPart.CanCollide = true
                walkPart.Transparency = 1
                walkPart.Size = Vector3.new(5, 0.01, 5)
                walkPart.CFrame = CFrame.new(root.Position + Vector3.new(0, -3.025, 0))
                walkPart.Parent = VFXFolder

                task.wait(0.1)
                if walkPart then walkPart:Destroy() end

            end)

            scriptRemote:FireServer(scriptName, actionName, "Begin")
            print("fired server: ", actionName)
            
        elseif inputState == Enum.UserInputState.End then
            if not abilityVariables.UsedMoves[actionName] then return end

            task.delay(0.35, function()
                scriptRemote:FireServer(scriptName, actionName, "End")
            end)
            
            task.delay(0, function()
                usingMove = false
                moveBeingUsed = nil
                abilityVariables.UsedMoves[actionName] = nil
            end)
            
            abilityVariables.OnCooldown[actionName] = true
            task.delay(abilityData[actionName].CD, function()
                abilityVariables.OnCooldown[actionName] = nil
            end)
        end
    end,
    Jupiter = function(actionName, inputState, inputObject)
        if abilityVariables.OnCooldown[actionName] then warn(tostring(actionName).." is currently on cooldown") return end

        local char = owner.Character
        local root = char:FindFirstChild("HumanoidRootPart")
        local hum = char:FindFirstChildOfClass("Humanoid")

        local minJumpVelocity = 150
        local maxJumpVelocity = 500
        
        if inputState == Enum.UserInputState.Begin then
            if usingMove then return end
            if abilityVariables.UsedMoves[actionName] then return end
            if not char:FindFirstChild(toolName) then return end
            
            usingMove = true
            moveBeingUsed = actionName
            abilityVariables.UsedMoves[actionName] = tick()

            local usedTime = abilityVariables.UsedMoves[actionName]

            print(actionName.." on client")

            abilityVariables.LastWS = hum.WalkSpeed
            hum.WalkSpeed = 8

            scriptRemote:FireServer(scriptName, actionName, "Begin")

            task.spawn(function()
                repeat task.wait() until not usedTime or ((tick() - usedTime) >= abilityData[actionName].MaxHoldTime)
                if not usedTime then return end
                abilities.Jupiter(actionName, Enum.UserInputState.End, inputObject)
            end)
            
        elseif inputState == Enum.UserInputState.End then
            if not abilityVariables.UsedMoves[actionName] then return end

            local usedTime = abilityVariables.UsedMoves[actionName]

            local holdDuration = math.clamp(tick() - usedTime, 0, abilityData[actionName].MaxHoldTime)
                
            -- Calculate jump velocity based on hold duration
            local lerpFactor = holdDuration / abilityData[actionName].MaxHoldTime

            scriptRemote:FireServer(scriptName, actionName, "End", lerpFactor)
            local jumpVelocity = minJumpVelocity + (maxJumpVelocity - minJumpVelocity) * lerpFactor
            
            -- Set up the LinearVelocity constraint
            local linearVelocity = Instance.new("LinearVelocity")
            local rootAttachment = root:FindFirstChild("RootAttachment") or Instance.new("Attachment")
            rootAttachment.Parent = root
            linearVelocity.Attachment0 = rootAttachment
            
            linearVelocity.VectorVelocity = Vector3.new(0,jumpVelocity*2,0)
            linearVelocity.RelativeTo = Enum.ActuatorRelativeTo.World
            linearVelocity.MaxForce = 10000*50  -- Ensure it’s strong enough to counter gravity
            linearVelocity.Parent = root

            hum.WalkSpeed = abilityVariables.LastWS or 16

            task.delay(0.2, function()
                linearVelocity.VectorVelocity = Vector3.new(0,jumpVelocity,0)
                --TS:Create(linearVelocity, TweenInfo.new(0.3, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {VectorVelocity = Vector3.new(0, jumpVelocity, 0)}):Play()
            end)

            task.delay(0.35, function()
                usingMove = false
                moveBeingUsed = nil
                abilityVariables.UsedMoves[actionName] = nil
            end)

            task.delay(0.2, function()
                if linearVelocity then linearVelocity:Destroy() end
            end)
            
            abilityVariables.OnCooldown[actionName] = true
            task.delay(abilityData[actionName].CD, function()
                abilityVariables.OnCooldown[actionName] = nil
            end)
        end
    end,
    Zephyr = function(actionName, inputState, inputObject)
        if abilityVariables.OnCooldown[actionName] then warn(tostring(actionName).." is currently on cooldown") return end

        local char = owner.Character
        local root = char:FindFirstChild("HumanoidRootPart")
        local hum = char:FindFirstChildOfClass("Humanoid")

        if inputState ~= Enum.UserInputState.Begin then return end
        --[[if usingMove then return end
        if abilityVariables.UsedMoves[actionName] then return end]]
        if not char:FindFirstChild(toolName) then return end
        
        hum:ChangeState(Enum.HumanoidStateType.Ragdoll)
        task.delay(abilityData[actionName].RagdollTime, function()
            if hum:GetState() == Enum.HumanoidStateType.Ragdoll then
                hum:ChangeState(Enum.HumanoidStateType.GettingUp)
            end
        end)

    end,
}

local function load_abilities()
    for name, data in pairs(abilityData) do
        CAS:BindAction(name, abilities[name], false, data.Keybind)
    end
end

--[ Script ]--

print(scriptName.." client script loaded on "..Players.LocalPlayer.Name)
repeat task.wait() until owner.Character or owner.CharacterAdded:Wait()
print("Owner character: "..owner.Character.Name.." gotten")

--[ Setup

load_abilities()

--[ Event Connections

owner.Backpack.ChildAdded:Connect(function(child)
    if child.Name == toolName and moveBeingUsed then
        abilities[moveBeingUsed](moveBeingUsed, Enum.UserInputState.End)
    end
end)
INFO