That was meant to be more of pseudo-code, this code works assuming you’ve defined humanoid
, and such. It’s more for an idea of how to fix your problem, not copy paste friendly code.
My current script is like this:
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(message)
processCommand(player, message)
end)
end)
function processCommand(speaker, message)
end
if message == script.MessageComand.Value then
local bro = game.Workspace:FindFirstChild(speaker.Name)
local newanim = script.AnimationOne:Clone()
newanim.Parent = bro
local hum = newanim.Parent.Humanoid
local anim = hum:LoadAnimation(bro.AnimationOne)
anim:Play()
end
local hum = Workspace.Player.FindFirstChild("humanoid")
if hum.Jumping:Connect(function()anim:Stop();
end)
then if (humanoid.speed < 0.1) then anim:Stop()
end
end
1 Like