I have this script here, but when I type "/e stop," it won't work. I've been trying to do this for 30 minutes now. Help!
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://27789359"
local animtrack = nil
function onChatted(message, player)
if message == ("/e classic") then
local character = game.Workspace[player.Name]
animtrack = character.Humanoid:LoadAnimation(animation)
animtrack:Play()
if message == ("/e stop")then
local character = game.Workspace[player.Name]
animtrack = character.Humanoid:LoadAnimation(animation)
animtrack:Stop()
end
end
end
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:connect(function(message) onChatted(message, player) end)
end)

1 comment
try not to seperate function it will be confusing.