#how would i add an animation and vfx to this script brah

1 messages · Page 1 of 1 (latest)

tepid ingot
#

ok so basically i know like 0.001% of coding but i wanna try making something for fun so like
how would i add an animation and vfx to this double jump script

local UserInputService = game:GetService("UserInputService")
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local canDoubleJump = true
local canDoubleJumpAfter = 0.5 -- Cooldown between jumps
local jumpPower = 50 -- Power of the double jump
local jumpCount = 0 -- Counter for jumps

local function onJumpRequest()
    if humanoid:GetState() == Enum.HumanoidStateType.Freefall and jumpCount < 1 then
        jumpCount = jumpCount + 1
        humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
        humanoid:Move(Vector3.new(0, jumpPower, 0))
        wait(canDoubleJumpAfter)
    end
end

UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.Space and not gameProcessed then
        onJumpRequest()
    end
end)

humanoid.StateChanged:Connect(function(_, newState)
    if newState == Enum.HumanoidStateType.Landed or newState == Enum.HumanoidStateType.Running then
        jumpCount = 0
    end
end)
raw ridge
#

learn 0.002% of coding

#

to add an animation u have to make one and publish it on roblox and then use an animator to play it

#

for vfx idk