Im making emote menu but when i press "1" to stop the animation it wont stop.
-- Variables -- local UserInputService = game:GetService("UserInputService") local Anim1 = script.Emote1 UserInputService.InputBegan:Connect(function(input) -- Emote 1 -- if input.KeyCode == Enum.KeyCode.One then local Player = game.Players.LocalPlayer local Character = Player.Character local Humanoid = Character:WaitForChild("Humanoid") local Gui = Player.PlayerGui:WaitForChild("EmoteMenu") local Emote1 = Humanoid:LoadAnimation(Anim1) if Gui.Main.Visible == true then script.EmotePlaying.Value = true Gui.Main.Visible = false game.ReplicatedStorage.EmoteMenu.UsedEmote1:FireServer(game.Players.LocalPlayer) Emote1:Play() Humanoid.WalkSpeed = 4 wait(6.7) Emote1:Stop() Humanoid.WalkSpeed = 26 script.EmotePlaying.Value = false -- Stop Emote elseif script.EmotePlaying.Value == true then Humanoid.WalkSpeed = 26 Emote1:Stop() script.EmotePlaying.Value = false if Character.HumanoidRootPart:FindFirstChild("Sound1") then Character.HumanoidRootPart.Sound1:Destroy() end end end end)
move line twelve up so that ur stopping and playing the same loaded animation. It should work now.
-- Variables -- local UserInputService = game:GetService("UserInputService") local Anim1 = script.Emote1 local Emote1 = Humanoid:LoadAnimation(Anim1) --here UserInputService.InputBegan:Connect(function(input) -- Emote 1 -- if input.KeyCode == Enum.KeyCode.One then local Player = game.Players.LocalPlayer local Character = Player.Character local Humanoid = Character:WaitForChild("Humanoid") local Gui = Player.PlayerGui:WaitForChild("EmoteMenu") --local Emote1 = Humanoid:LoadAnimation(Anim1) if Gui.Main.Visible == true then script.EmotePlaying.Value = true Gui.Main.Visible = false game.ReplicatedStorage.EmoteMenu.UsedEmote1:FireServer(game.Players.LocalPlayer) Emote1:Play() Humanoid.WalkSpeed = 4 wait(6.7) Emote1:Stop() Humanoid.WalkSpeed = 26 script.EmotePlaying.Value = false -- Stop Emote elseif script.EmotePlaying.Value == true then Humanoid.WalkSpeed = 26 Emote1:Stop() script.EmotePlaying.Value = false if Character.HumanoidRootPart:FindFirstChild("Sound1") then Character.HumanoidRootPart.Sound1:Destroy() end end end end)