local TeleportService = game:GetService("TeleportService")
local dummy = game.Workspace.Dummy
local humDummy = dummy:WaitForChild("Humanoid")
local anim = dummy.Script.Chillidle
local loadedAnim = humDummy:LoadAnimation(anim)
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if msg == "test" then
game.Workspace.Sound.Playing = false
script.Sound:Play()
loadedAnim:Play()
wait(12)
TeleportService:Teleport(10447589013, player)
end
end)
end)
Update, thanks you script works but i wasn’t really clear
The animation start playing but i already have another looped animation
so it just reset, sorry
The chillidle is the first animation and i want it to be replace or disabled for play the other one
local TeleportService = game:GetService("TeleportService")
local dummy = game.Workspace.Dummy
local humDummy = dummy:WaitForChild("Humanoid")
local anim = dummy.Script.Animation
local loadedAnim = humDummy:LoadAnimation(anim)
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if msg == "test" then
for i,v in pairs(humDummy:GetPlayingAnimationTracks()) do
v:Stop()
end
game.Workspace.Sound.Playing = false
script.Sound:Play()
loadedAnim:Play()
wait(12)
TeleportService:Teleport(10447589013, player)
end
end)
end)
Alright this should work, GetPlayingAnimationTracks gets all playing animations in a table, then we run a loop to stop all the animations in the list.