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

This Animation Script Is Unable To Run. It has 2 Errors I am unable to fix. Could Anyone Help?

This is my script that wont work for some reason

local rp = game:GetService("ReplicatedStorage")
local Combat = rp:WaitForChild("Combat")

local Animations = script:WaitForChild("Animations")

local anims = 
{
		Animations:WaitForChild("Kick")
		Animations:WaitForChild("Left")
		Animations:WaitForChild("Right")
		Animations:WaitForChild("Gut")
}

Combat.OnServerEvent:Connect(function(player,count)
	local Character = player.Character
	local Humanoid = Character:WaitForChild("Humanoid")
	
	local attack = Humanoid:LoadAnimations(anims[count])
	attack:Play()
	
end)
	

Im trying to run a animation nothing has errors the errors are Error: (12,1) Syntax error: Expected identifier when parsing expression, got '}' and Error: (9,3) Syntax error: Expected '}' (to close '{' at line 7), got 'Animations'

2 comments

0

This makes no sense. There’s not a single syntax error

0

Yessir nosier

2 answers

✓ Accepted answer

The tables, should have commas (,) to separate the contents.

For example:

--Wrong Table example:
local table = {
1
2
3
4
}
--Correct Table example:
local table = {
1,
2,
3,
4
}

Hope this help you.

Have an excellent day

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