I am trying to Weld a Model to a Player, with the Weld Function in a ModuleScript, called "ModuleFunctions", then calling it in a LocalScript. There is nothing in the Output that relays an error of any sort. These are the two scripts:
Module:
function Weld1(Object, Object_Path, Middle, Part, Part_Path)
local Model = game[Object_Path][Object]:clone()
Model.Parent = game.Workspace[Part_Path][Part]
local C = Model:GetChildren()
for i=1, #C do
if C[i].className == "Part" or C[i].className == "Union Operation" then
local W = Instance.new("Weld")
W.Part0 = Model[Middle]
W.Part1 = C[i]
local CJ = CFrame.new(Model[Middle].Position)
local C0 = Model[Middle].CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = Model[Middle]
end
local Y = Instance.new("Weld")
if Part == nil then
Y.Part0 = game.Workspace[Part_Path]
elseif Part ~= nil then
Y.Part0 = game.Workspace[Part_Path][Part]
end
Y.Part1 = Model[Middle]
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
local h = Model:GetChildren()
for i = 1, # h do
h[i].Anchored = false
h[i].CanCollide = false
end
end
return Weld1
Local Script:
ModuleFunction = require(game.Workspace.ModuleFunctions)
Player = game.Players.LocalPlayer
Humanoid = Player.Character:WaitforChild("Humanoid")
player = Humanoid.Parent
ModuleFunction("Hook", "Lighting", "Middle", "Right Arm", "Player1")
EDIT I have tried this Local Script too, and it hasn't worked:
ModuleFunction = require(workspace.ModuleFunctions)
Player = game.Players.LocalPlayer
Humanoid = Player.Character:WaitforChild("Humanoid")
player = Humanoid.Parent
a = game.Workspace:WaitForChild("Player1")
ModuleFunction("Hook", "Lighting", "Middle", "Right Arm", a)

2 comments
You never returned your function in the Module script. Try adding the line 'return Weld1' to the bottom of the script.
I tried that and it didn't seem to effect anything