#I dont even know anymore

1 messages · Page 1 of 1 (latest)

tired wren
#

why is this underlined

upper moat
#

Uppercase

tired wren
peak osprey
tired wren
#

wdym

peak osprey
#

you defined humanoid

#

not animator

tired wren
#

yeah cuz its under humanoid

peak osprey
#

ik

tired wren
#

ooh

#

I get what you mean now

peak osprey
#

yeah

tired wren
#

will this still work with multiple characters:

#

?

#

wait nvm

#

its local

peak osprey
#

local Animator = ...

#

instead of local humanoid

tired wren
#

ik I just did that

#

it should be able to find the animator now

#

how would I make it play an animation

quiet schooner
tired wren
#

thanks

#

what if I wanna make it stop?

tired wren
rich knot
#
local stanceAnimation = ReplicatedStorage:WaitForChild("Anims"):WaitForChild("StanceAnim")

local stanceTracks = {}

stanceHeld.OnServerEvent:Connect(function(player)
    local character = player.Character
    if not character then return end

    local humanoid = character:FindFirstChildOfClass("Humanoid")
    if not humanoid then return end

    local animator = humanoid:FindFirstChildOfClass("Animator")
    if animator and stanceAnimation then
        local track = animator:LoadAnimation(stanceAnimation)
        track:Play()
        track.Looped = true
        stanceTracks[player] = track
    end
end)
#

example

#
local track = animator:LoadAnimation(YOUR ANIM VARIABLE)
track:Play()
#

to stop it

#

use

#
 track:Stop()
rich knot
#

otherwise the script wont actually know what "animation" is

cunning shadowBOT
#

studio** You are now Level 12! **studio

tired wren
#

sorry for not replying

cunning shadowBOT
#

studio** You are now Level 6! **studio

tired wren
tired wren
# rich knot Show the whole script
local UserInputService = game:GetService("UserInputService")
local animation = ("UwalkAnim")

local function onInputStarted(inputObject, processedEvent)
    if processedEvent then return end
    
    if inputObject.KeyCode == Enum.KeyCode.LeftShift then
        local character = Players.LocalPlayer.Character
        if not character then return end
        
        local humanoid = character:FindFirstChildOfClass("Humanoid")
        if not humanoid then return end
        
        local animator = humanoid:FindFirstChildOfClass("Animator")
        if not animator then return end
        
        humanoid.WalkSpeed = 30
        animator:LoadAnimation(animation):Play(133873410833807)
    end
end

local function onInputEnded(inputObject, processedEvent)
    if processedEvent then return end

    if inputObject.KeyCode == Enum.KeyCode.LeftShift then
        local character = Players.LocalPlayer.Character
        if not character then return end

        local humanoid = character:FindFirstChildOfClass("Humanoid")
        if not humanoid then return end
        
        local animator = humanoid:FindFirstChildOfClass("Animator")
        if not animator then return end

        humanoid.WalkSpeed = 16
    end
end

UserInputService.InputBegan:Connect(onInputStarted)

UserInputService.InputEnded:Connect(onInputEnded)```