--//Services & Instances
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local Events = ReplicatedStorage:WaitForChild("events")
local On_Combat = Events:WaitForChild("on_combat")
--//Variables
local List = {
'rbxassetid://13366667405'
}
--// Functions
local function onRegisterOnMouse(Player)
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
Humanoid:LoadAnimation(13366667405):Play()
end
On_Combat.OnServerEvent:Connect(onRegisterOnMouse)
First off.
Where is the error? Which line?
Second off
More context please?
Sorry if that sounds harsh
:LoadAnimation takes in an Animation object, not the AnimationId itself. Lookup the script example given in the API documentation Animator | Roblox Creator Documentation.
Furthermore, Humanoid:LoadAnimation is deprecated, use Humanoid.Animator:LoadAnimation