-
What do you want to achieve?
I want to grab info from a moduleScript and use it. -
What is the issue?
I keep getting this error
Players.cakeycocoa.PlayerGui.Computer.bg.Desktop.AppGUIs.Ropera.urlManager:27: invalid argument #2 (string expected, got nil) - Client - urlManager:27
It says that this variable in the module script is nil even tho it isnt??? -
What solutions have you tried so far?
I asked on discord bc I have no idea what to even google for this.
local urls = script.Parent.Webs
local web = require(game:GetService("ReplicatedStorage"):WaitForChild("ModuleScripts").Websites)
local Sites = script.Parent.Webs
local searchBox = script.Parent.topBar.url
local currentSiteIndex = 1
local function loadSite(frameName)
local webIndex
for index, value in pairs(web.frameName) do -- looks for the right index
if value == frameName then
webIndex = index
break
end
end
if not web.isOpen[webIndex] then -- if site is open it will continue, else it will not
Sites.NoWebFound.Visible = true
return
else
Sites.NoWebFound.Visible = false
end
Sites[web.frameName[webIndex]].Visible = true
Sites[web.frameName[currentSiteIndex]].Visible = false -- error is this line
searchBox.Text = web.urlStart..web.urls[webIndex]..web.urlEnd
currentSiteIndex = webIndex
end
Sites.RoperaWiki.websScrolling.Mancante.gateway.Activated:Connect(function()
loadSite("Mancante")
end)
Module Script
local module = {
urlStart = "http://",
urlEnd = ".acn",
urls = {
TheRoperaWikiI = "dd7hrne0204dmw12eo91",
Mancante = "da673a8284e22ke239ca2",
},
siteNames = {
TheRoperaWikiI = "The Ropera Wiki I",
Mancante = "Mancante"
},
siteDescriptions = {
TheRoperaWikiI = "The starting place to anyone who ventures into the dark side of Ropera.",
Mancante = "The starting place to anyone who ventures into the dark side of Ropera."
},
locations = {
TheRoperaWikiI = "Given by Cakeycocoa",
Mancante = "Found in The Ropera Wiki I"
},
isOpen = {
TheRoperaWikiI = true,
Mancante = true
},
frameName = {
TheRoperaWikiI = "RoperaWiki",
Mancante = "Mancante"
}
}
return module