Changing a part's name sent through a script to a module scripts

Hello, is there a way to send a parts properties over to a module script and then actually change them on the module script? In my case, I’m looking to change the name of a model through the module script but I’m unsure how to do that.

It’s just how you would do it using a normal function.

Think of module scripts as a place where you can store functions and then easily call them later.

Sample Code

--Module
local module = {}

module:ChangeName(model,name)
    model.Name = name
end

return module


--Script

local module = require(Path.to.module)

module:ChangeName(YourModel,"NewName")

2 Likes