Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Simple animationscript not playing the animation?

game:GetService("Players")
plr = game.Players.LocalPlayer

game.ReplicatedStorage.CoffeeRemotes.Drink.OnClientEvent:Connect(function()
	local ANim = plr.Character.Humanoid:LoadAnimation(game.Workspace.Animation)
	ANim:Play()
end)

Simple script, but it doesn't play the Animation. Why? (No errors!) Also, if theres a way to make the animation visible for ALL clients, it would be even better.

Thanks in advance!

1 answer

You need to set it as a priority, and the animation should be in replicated storage.

game:GetService("Players")
plr = game.Players.LocalPlayer
local ANim = plr.Character.Humanoid:LoadAnimation(game.ReplicatedStorage.Animation)

ANim.Priority = Enum.AnimationPriority.Action

game.ReplicatedStorage.CoffeeRemotes.Drink.OnClientEvent:Connect(function()
   ANim:Play()
end)

1 comment

0

The animation can be anywhere as long as the Client can access it.

This discussion is preserved as it was. New answers, comments, and votes are closed.