Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why doesnt this work?

--// Script
local MyLibrary = require(game.ServerScriptService.ModuleScript)

MyLibrary.CreateObject("Sparkles", game.Workspace.SpawnLocation, Color3.new(85, 255, 0))

--// ModuleScript

local MyLibrary = {}
MyLibrary.Output = function(str)
print(str)
end

MyLibrary.CreateObject = function(type, parent, sparklecolor)
Instance.new(type, parent, sparklecolor)
end

return MyLibrary




4 comments

0

SparkleColor is not a valid argument of Instance.new(). You need to make a new line to set the SparkleColor.

0

Like how?

0

You would make a new line in the CreateObject function to change the sparklecolor...

0

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

1 answer

✓ Accepted answer

Try using it

--// Script

local MyLibrary = require(game.ServerScriptService.ModuleScript)
MyLibrary.CreateObject("Sparkles", game.Workspace.SpawnLocation, Color3.new(85/255, 255/255, 0/255))

--// ModuleScript

local MyLibrary = {}
MyLibrary.Output = function(str)
print(str)
end

MyLibrary.CreateObject = function(type, parent, color)
local int = Instance.new(type, parent)
if color ~= nil then
int.SparkleColor = color
end
end

return MyLibrary

This discussion is preserved as it was. New answers, comments, and votes are closed.