What does the error "tables cannot be cyclic" mean and how can I fix it?
I've been getting an error in testing on my game that says that "tables cannot be cyclic". The code is shown below. Is there a reason for why this is happening? Thanks!
LOCALSCRIPT1:
1 | plr.PlayerGui.Attacks.Frame.LocalScript.Spawn:Invoke(atks) |
LOCALSCRIPT2:
01 | local at 1 = script.Parent:FindFirstChild( "Attack1" ) |
03 | local at 2 = script.Parent:FindFirstChild( "Attack2" ) |
05 | local at 3 = script.Parent:FindFirstChild( "Attack3" ) |
07 | local at 4 = script.Parent:FindFirstChild( "Attack4" ) |
10 | function change(m 1 ,m 2 ,m 3 ,m 4 ) |
11 | local atks = game.ReplicatedStorage.Attacks.AddAttacks:InvokeServer(m 1 ,m 2 ,m 3 ,m 4 ) |
12 | for n,v in pairs (atks) do |
15 | at 1 :FindFirstChild( "Name" ).Text = v [ 1 ] |
16 | at 1 :FindFirstChild( "PP" ).Value = v [ 2 ] |
18 | at 1. ImageColor 3 = Color 3. new(v [ 3 ] [ 2 ] ,v [ 3 ] [ 3 ] ,v [ 3 ] [ 4 ] ) |
19 | at 1. Background.Visible = true |
25 | at 2 :FindFirstChild( "Name" ).Text = v [ 1 ] |
26 | at 2 :FindFirstChild( "PP" ).Value = v [ 2 ] |
28 | at 2. ImageColor 3 = Color 3. new(v [ 3 ] [ 2 ] ,v [ 3 ] [ 3 ] ,v [ 3 ] [ 4 ] ) |
29 | at 2. Background.Visible = true |
35 | at 3 :FindFirstChild( "Name" ).Text = v [ 1 ] |
36 | at 3 :FindFirstChild( "PP" ).Value = v [ 2 ] |
38 | at 3. ImageColor 3 = Color 3. new(v [ 3 ] [ 2 ] ,v [ 3 ] [ 3 ] ,v [ 3 ] [ 4 ] ) |
39 | at 3. Background.Visible = true |
45 | at 4 :FindFirstChild( "Name" ).Text = v [ 1 ] |
46 | at 4 :FindFirstChild( "PP" ).Value = v [ 2 ] |
48 | at 4. ImageColor 3 = Color 3. new(v [ 3 ] [ 2 ] ,v [ 3 ] [ 3 ] ,v [ 3 ] [ 4 ] ) |
49 | at 4. Background.Visible = true |
52 | end end end end end end |
54 | function script.Spawn.OnInvoke(g) |
55 | change(g [ 1 ] ,g [ 2 ] ,g [ 3 ] ,g [ 4 ] ) |
SERVERSCRIPT:
01 | function game.ReplicatedStorage.Attacks.AddAttacks.OnServerInvoke(plr,m 1 ,m 2 ,m 3 ,m 4 ) |
04 | moves [ 1 ] = { m 1 ,attacks [ m 1 ] [ 1 ] ,attacktypes [ attacks [ m 1 ] [ 2 ] ] } |
07 | moves [ 2 ] = { m 2 ,attacks [ m 2 ] [ 1 ] ,attacktypes [ attacks [ m 2 ] [ 2 ] ] } |
10 | moves [ 3 ] = { m 3 ,attacks [ m 3 ] [ 1 ] ,attacktypes [ attacks [ m 3 ] [ 2 ] ] } |
13 | moves [ 4 ] = { m 4 ,attacks [ m 4 ] [ 1 ] ,attacktypes [ attacks [ m 4 ] [ 2 ] ] } |