I wanted the part to change textures onclick but, it won't even change?
local gift = script.Parent.Parent.Gift
local mesh = gift.Mesh
local texture = mesh.TextureId
local right = script.Parent.Parent.Right
local click = right.ClickDetector
local id = "rbxassetid://"
local sn = 1
texture = {189748284,189783253 }
function onClicked()
sn = sn + 1
if sn > #texture then sn = 1 end
texture = id..texture[sn]
end
for i=1,#texture do
print(i)
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Error:attempt to concatenate field '?' (a nil value)
help with explainations please?

1 comment
Thanks so much c: