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)```