this = script.Parent
function fademodel(part, modelname)
if part ~= nil then
model = game.Lighting.Models:findFirstChild(modelname)
modelchildren = model:GetChildren()
tempmodel = Instance.new("Model")
tempmodel.Name = model.Name
tempmodel.Parent = game.workspace.FadeModelTest.Models
for i, v in ipairs(modelchildren) do
local t = v:clone()
local temp = v.CFrame
t.Parent = tempmodel
t.CFrame = temp
wait(.25)
end
end
end
print("here")
this.Touched:connect(fademodel(part))
This is my script. I'm trying to make a part that, when you touch it, it will bring a model out from the lighting but in a more light on resources kind of way. The issue is, that this line: this.Touched:connect(fademodel(part)) is throwing the error: Attempt to connect failed: Passed value is not a function
I've got a feeling it's just some dumb typo that I can't seem to find, but it might be something else. Any help would be appreciated.

1 comment
Thanks for the help, I wanted to do it with the for loop because I'm going to be using this with very high brick count models so I don't want to lag players by moving everything at once.