I'm getting an error and I don't know how to fix it

So for my script here:

local strike = game.ReplicatedStorage.Remotes.SkillStrike

local strikes_table = {
	Basic = {
		Animation = "rbxassetid://5053852957",
		Skill = 1
	},
	Double = {
		Animation = "rbxassetid://5056287197",
		Skill = 5
	},
	Spin = {
		Animation = "rbxassetid://5056272042",
		Skill = 8
	},
}

strike.OnServerEvent:Connect(function(plr, skill)
	local stat = plr:WaitForChild('leaderstats').Skill
	
	local human = plr.Character:WaitForChild("Humanoid")
	local anim = Instance.new("Animation")
	
	for i, v in pairs(strikes_table) do
		if i == skill then
			anim.AnimationId == v.Animation
		end
	end
	
	local plrAnim = human:LoadAnimation(anim)
	plrAnim:Play()
end)

You do a certain skill based on the parameter skill. Somehow this line:

anim.AnimationId == v.Animation

is erroring. It says:

Incomplete statement: expected assignment or a function call

How do I fix this? I have no idea how to.

You’re using the assigned to operator (==), when you’re supposed to use the assignment operator (=):

anim.AnimationId = v.Animation
1 Like

Dangit, I thought it would be something really stupid.

I guess I’m blind then.