I'm using a separate module script to store my huge tables so that my computer doesn't slow down while writing scripts.
11:36:37.916 - Players.benbebop.PlayerScripts.mainModule:127: attempt to call a table value 11:36:37.917 - Stack Begin 11:36:37.923 - Script 'Players.benbebop.PlayerScripts.mainModule', Line 127 - function newSplash 11:36:37.924 - Script 'ReplicatedFirst.initialiser', Line 77 11:36:37.926 - Stack End
I haven't changed anything from how I normally create module scripts and dont recognize this error. Looking it up returns cases that have nothing to do with my situation. What could be causing this?
Data Module, with tables reduced in size for obvious reasons
local module = {}
function module.getData(num)
if num == "Splashes" then
local splashes = {"As seen on TV!","Awesome!","100% pure!"}
return tostring(splashes[math.random(1, #splashes)])
elseif num == "ASCIILibrary" then
return {"NUL","SOH"}
elseif num == "ASCIILibraryLenght" then
--return {0,0,0}
end
end
return module
Requesting script, getData is the above script
function mainModule.newSplash()
local dir = game.Players.LocalPlayer.PlayerGui.Menu.TextDomain
local Splash = getData("Splashes")
if Splash == "V_CHANCESPLASH" then
Splash = "This splash is 1 in " .. #Splashes .. "!"
end
if math.random(1, 10000) == 1 then
Splash = ""
end
local stringData = {}
wait(0.1)
dir:ClearAllChildren()
mainModule.writeText(Splash, Color3.fromRGB(255, 255, 0), dir, true, "Center", "Center")
local goal = {}
goal.Size = UDim2.new(0, 346, 0, 93)
TweenService:Create(dir, TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.In, -1, true), goal):Play()
end
writeText Function in case it is needed
function mainModule.writeText(text, color, dir, shadow, alignmentx, alignmenty)
local newLine = Instance.new("Frame")
newLine.Name = "Line"
newLine.LayoutOrder = 0
newLine.Size = UDim2.new(1, 0, 0, 16)
newLine.BackgroundTransparency = 1
newLine.Parent = dir
local sorter = Instance.new("UIListLayout")
sorter.Padding = UDim.new(0,0)
sorter.FillDirection = Enum.FillDirection.Horizontal
sorter.SortOrder = Enum.SortOrder.LayoutOrder
sorter.HorizontalAlignment = Enum.HorizontalAlignment[alignmentx]
sorter.VerticalAlignment = Enum.VerticalAlignment[alignmenty]
sorter.Parent = newLine
local vertSorter = Instance.new("UIListLayout")
vertSorter.Padding = UDim.new(0,0)
vertSorter.FillDirection = Enum.FillDirection.Vertical
vertSorter.SortOrder = Enum.SortOrder.LayoutOrder
vertSorter.HorizontalAlignment = Enum.HorizontalAlignment[alignmentx]
vertSorter.VerticalAlignment = Enum.VerticalAlignment[alignmenty]
vertSorter.Parent = dir
for i=1,string.len(text) do
local char = string.sub(text, i, i)
if char == " " then
char = "SPACE"
elseif char == string.char(10) then
newLine = Instance.new("Frame")
newLine.Name = "Line"
newLine.LayoutOrder = i
newLine.Size = UDim2.new(1, 0, 0, 16)
newLine.BackgroundTransparency = 1
newLine.Parent = dir
local sorter = Instance.new("UIListLayout")
sorter.Padding = UDim.new(0,0)
sorter.FillDirection = Enum.FillDirection.Horizontal
sorter.SortOrder = Enum.SortOrder.LayoutOrder
sorter.HorizontalAlignment = Enum.HorizontalAlignment[alignmentx]
sorter.VerticalAlignment = Enum.VerticalAlignment[alignmenty]
sorter.Parent = newLine
char = "NUL"
end
if shadow == true then
local vectColor = Vector3.new(color.r, color.g, color.b)
local characterShadow = script.Parent.Cache.Font["ascii_" .. char]:Clone()
characterShadow.LayoutOrder = i
local calcColor = vectColor - Vector3.new(0.752941, 0.752941, 0.752941)
characterShadow.ImageColor3 = Color3.new(calcColor.x, calcColor.y, calcColor.z)
local character = characterShadow:Clone()
character.Parent = characterShadow
character.Position = UDim2.new(0.5,-2,0.5,-2)
character.Size = UDim2.new(1, 0, 1, 0)
character.ImageColor3 = color
characterShadow.Parent = newLine
else
local character = script.Parent.Cache.Font["ascii_" .. char]:Clone()
character.Parent = newLine
character.ImageColor3 = color
end
end
return
end
