Why it doesnt prints what animation is playing?

Hello everyone, its been long time since i was trying so fix something in Roblox animate script, i highly require help, its been already 3 hours of suffering.

game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
	local emote = ""
	if msg == "/e dance" then
		emote = dances[math.random(1, #dances)]
	elseif (string.sub(msg, 1, 3) == "/e ") then
		emote = string.sub(msg, 4)
	elseif (string.sub(msg, 1, 7) == "/emote ") then
		emote = string.sub(msg, 8)
	end

	if (pose == "Standing" and emoteNames[emote] ~= nil) then
		playAnimation(emote, 0.1, Humanoid)
		if emote == "dance1" then
			print("Emote is dance1!")
		end
	end
end)

This is a snippet from Animate script, i tried all methods but couldnt get it to print what animation is playing, i may sound dumb but i really need help.

2 Likes

This is in the wrong category, so the post might get taken down if you don’t change to Scripting Support.

Maybe check if “dance1” isn’t accurate or lining up with the original table of emotes?

2 Likes

Are there any errors given? Try this script in its place and tell me what prints out, there could be an underlying issue

game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
	local emote = ""
	if msg == "/e dance" then
		emote = dances[math.random(1, #dances)]
	elseif (string.sub(msg, 1, 3) == "/e ") then
		emote = string.sub(msg, 4)
	elseif (string.sub(msg, 1, 7) == "/emote ") then
		emote = string.sub(msg, 8)
	else
		print(msg)
	end

	if (pose == "Standing" and emoteNames[emote] ~= nil) then
		playAnimation(emote, 0.1, Humanoid)
		if emote == "dance1" then
			print("Emote is dance1!")
		end
	end
end)
2 Likes