Hey all! After a (long) hiatus from scripting, I'm back! This time working on another weather-related project, completely separate from the last one. I'm running some tests, and I came across this error: "attempt to index nil with number." I'm making a system which retrieves data from a module script in ReplicatedStorage, then pastes it onto a UI.
LocalScript:
local rs = game:GetService("ReplicatedStorage")
local weatherData = require(rs:WaitForChild("WeatherData"))
local bar = script.Parent
local radar = bar.Radar
local gameSettings = bar.Settings
local gameTime = bar.Time
local windspeed = bar.Windspeed
local rainlevel = bar.RainLevel
local category = bar.Category
function update()
local data = weatherData:GetInfo()
gameTime.Text = data[1] --Pretty much this whole part errors
windspeed.Text = data[2].." MPH"
rainlevel.Text = data[3].." Rain"
category.Text = "CAT "..data[4]
end
update()
ModuleScript:
local lighting = game:GetService("Lighting")
local module = {}
module.gameTime = lighting.TimeOfDay
module.windspeed = 0
module.rainlevel = "None"
module.category = 0
function module:GetInfo()
local data = {module.gameTime, module.windspeed, module.rainlevel, module.category}
end
return module
Plz help!

1 comment
omg lol im so dumb. As I said, I did take a long time away from scripting tho XD