local T = {1, 2, 3}
local S = T
S[1] = 4
print(T) --prints out {4, 1, 3}
Expected behavior
It’s supposed to stay as it was since i didn’t change it in any way, or does the S table link to the T table? Wasn’t written anywhere anything about it.
I tried different ways like using table.clone() (somewhy it didnt work the first time), moving it to another module script, changing the variable in module script to a getfunction, freezing the table.
its just linking variable to another variable heres same thing but with part in workspace
local baseplate = workspace.Baseplate -- <--- referencing some object
local anotherlinktobaseplate = baseplate -- <--- linking baseplate value to another one
anotherlinktobaseplate = "my name got changed" -- <--- name change
print(baseplate.Name) -- output "my name got changed"