Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to clone multiple things with a private module?

Asked by
j5707r -36
6 years ago

So, here is the current code to clone ONE object with the private module:

local module = {}
password = 12345
function module.ReturnTheThing(argument)
if argument == password then
return script.Script:Clone()
end
end

return module

I then tried to clone another thing by this:

local module = {}
password = 12345
function module.ReturnTheThing(argument)
if argument == password then
return script.Script:Clone()
return script.Part:Clone()
end
end

return module

It didn't work

1 answer

Log in to vote
0
Answered by
H4X0MSYT 536 Moderation Voter
6 years ago

You cannot do multiple returns. HOWEVER, return can return multiple objects.

return script.Parent:Clone(), script.Part:Clone()

local Parent, Part = require(module).ReturnTheThing(12345)

-->> **script.Script:Clone()** is the first arg, **script.Part:Clone()** is the second arg returned.
0
Note that this isnt actually a fully functioning script.. The first line is supposed to be part of the module script H4X0MSYT 536 — 6y
Ad

Answer this question