I have multiple modules, all with the same name, but some have a function called updateModel and others don’t. When I call the updateModel function in a module that doesn’t have the function I get an error. I was wondering if there was a way to check if the function is there before calling it.
Script that errors:
if tile:FindFirstChildOfClass("Model") and tile:FindFirstChildOfClass("Model"):FindFirstChild("Visuals") then
local mod = require(tile:FindFirstChildOfClass("Model").Visuals)
mod.updateModel() --This is the line that is causing the error.
end
reposted because accidentally posted in bulletin board and replies got locked