Script not finding object

I have a pretty weird problem. I am just trying to access a model instance using a script but it won’t find it. I literally do this:

    script.Parent.ModelName

Intellissense doesn’t show anything and when I run the script it also throws an error that the instance is nil which it is clearly not because I still see it in the explorer window.

I have looked on the forum but couldn’t really find anyone experiencing the same problem as me.
I have tried everything that might be the problem but none of it was the actual problem.

Has anyone an idea what is causing this because this is a case where I cannot use logic to solve it. Its just straight up weird. Is it a problem with studio maybe?

3 Likes

use this code

require(script.Parent.ModelName)

and in module use this function type :

local module = {} --[[ or your in module name]] 

function module.FunctionName()
end

return module

Its a Model not a ModuleScript