currently I’m trying to make a checkpoint system using modules to “save” a value
the module value i want to save
local example = {}
example.group = {}
-- example.group gets changed alot throughout the game
return example
the problem is when i try to set a value inside another module to example.group, the value gets sort of “connected” and this would happend
-- this is another module
-- lets say i want example.group current value, i would do this.
local savedvalued = example.group
-- and then after awhile, example.group gets updated, but i run a
-- function to set example.group to savedvalue.
example.group = savedvalue
this doesnt work though, savedvalue would have example.group current value and not the one i wanted saved beforehand.
how would i make it so that savedvalue stays the same without being changed if example.group ever gets updated?