#Emoting

1 messages · Page 1 of 1 (latest)

tall scaffold
#

Im having a problem with making B use an emote, idk how to fix it

local Emoting = false
local speed = 0
local UserInputService = game:GetService("UserInputService")
local Plr = game.Players.LocalPlayer
local Char = Plr.Character or Plr.CharacterAdded:Wait()
local Hum = Char:WaitForChild("Humanoid")
local Animator = Hum:WaitForChild("Animator")
local SprintAnim = Animator:LoadAnimation(script:WaitForChild("SelfPaced"))
local emotespeed = 0.2

local function StopEmoting()
    if Emoting then
        Emoting = false
        Hum.WalkSpeed -= emotespeed
    end
end

local function StartEmoting()
    if not Emoting then
        Emoting = true
        Hum.WalkSpeed += emotespeed
    end
end

UserInputService.InputBegan:Connect(function(input, isTyping)
    if isTyping then return end
    if input.KeyCode == keybind then
        if not Emoting then
            StartEmoting()
        else
            StopEmoting()
        end
    end
end)```
uneven sapphire
#

you gotta use an animator to play the emote?

#
local function StartEmoting()
    if not Emoting then
        Emoting = true
        Hum.WalkSpeed += emotespeed
        SprintAnim:Play()
    end
end

local function StopEmoting()
    if not Emoting then
        Emoting = true
        Hum.WalkSpeed += emotespeed
        SprintAnim:Pause()
    end
end
tall scaffold
#

i lowkey forgot about that