I’m trying to make an emote for my game that plays when the player presses “1”. I am experiencing one problem however, the animation does not loop, and I have no clue why. This started happening after I used RemoteEvents to play the emote on the server.
This is the LocalScript that detects when the player presses “1”.
--Player variables
local emotePlay = game.ReplicatedStorage:WaitForChild("EmotePlay")
local uis = game:GetService("UserInputService")
local players = game:GetService("Players")
local localPlayer = players.LocalPlayer
local char = script.Parent
local humanoid = char:WaitForChild("Humanoid")
--Emote variables
local dab = char:WaitForChild("Dab")
local dabAnim = humanoid:LoadAnimation(dab)
dabAnim.Looped = true
--When the player presses a key
uis.InputBegan:Connect(function(input, gpe)
if input.KeyCode == Enum.KeyCode.One and not gpe then
emotePlay:FireServer(dab)
print(dabAnim.Looped)
end
end)
This is the server script that plays the emote.
local emotePlay = game.ReplicatedStorage.EmotePlay
emotePlay.OnServerEvent:Connect(function(player, anim)
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local emote = humanoid:LoadAnimation(anim)
emote.Looped = true
print(emote.Looped)
emote.Priority = Enum.AnimationPriority.Action
emote:Play()
end)
-
What do you want to achieve? I want to make an emote that will play when the player presses “1”.
-
What is the issue? The emote isn’t looped.
-
What solutions have you tried so far? I found a similar post about my issue, however, I checked, and the Looped property is true for both the Client and the Server.
There are no errors, and everything seems correct, so I ave no clue why the emote isn’t looped.