--ProjectileScript (ModuleScript)
local Create = assert(LoadLibrary("RbxUtility")).Create
local projectiles = {
icebolt = {
Name = "Icebolt",
Parent = Workspace,
BrickColor = BrickColor.new("Bright blue"),
Reflectance = .5,
Transparency = .2,
Anchored = true,
FormFactor = Enum.FormFactor.Custom,
Size = Vector3.new(1, .4, .4),
};
}
function fire(target, projectile)
print(target)
print(projectile)
print(projectiles)
print(projectiles[projectile])
local proj = Create("Part")(projectiles[projectile])
end
return{
Fire = fire
}
--Normal Script
local proj = require(script.Parent.ProjectileScript)
proj:Fire(Workspace, "icebolt") --The error is here. That colon should have been a dot.
When I test this, I get this output:
table: 14C2D248
Workspace
table: 14C2D1B8
nil
I should be getting something like this:
Workspace
icebolt
table: ########
table: ########
Where is that table argument coming from, and why?
After some careful looking, I realized that I had been calling Fire as a method instead of as a function. Woops.
