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 months 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 — 3mo

2 answers

Log in to vote
0
Answered by 3 months 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 months ago

nowmdjewrfwbahf

0
No MAD_DENISDAILY2 137 — 3mo

Answer this question