Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

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'

0
This makes no sense. There’s not a single syntax error MAD_DENISDAILY2 137 — 3y
0
Yessir nosier TestAccount_PinkLeaf 14 — 2y

2 answers

Log in to vote
0
Answered by 3 years ago

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

Ad
Log in to vote
0
Answered by 3 years ago

nowmdjewrfwbahf

0
No MAD_DENISDAILY2 137 — 3y

Answer this question