i'm trying to make a shouting sim esq game with some friends and due to my lack of proper knowledge of decent scripting i can't figure out how to get the module script to not return nil
(yes we are aware about the roblox audio purge we'll find a way around it)
the server script (event handler)
--// Variables
local rs = game.ReplicatedStorage
local ss = game.ServerStorage
local sss = game.ServerScriptService
local pointScript = require(rs.ModuleScripts.EpicPoints)
--// Functions
--// addPoints function
local function addPoints(plr,points)
local plrPoints = ss.Points:FindFirstChild(plr.Name)
plrPoints.Value += points
end
--// Shout function
local function shout(points,plr)
addPoints(points,plr)
end
--// Shouted event
rs.Events.Shouted.OnServerEvent:Connect(function(points,plr)
shout(points,plr)
end)
the startergui script (button stuff)
--// Variables
local plr = game.Players.LocalPlayer
local rs = game.ReplicatedStorage
local ss = game.ServerStorage
local sss = game.ServerScriptService
local ui = script.Parent
local shoutButton = ui.ShoutButton
local shoutNumber = shoutButton.ShoutNumber
local pointScript = game.ReplicatedStorage.ModuleScripts.EpicPoints
local pointTable = require(pointScript)
--// Main script
--// Shout button clicked
shoutButton.MouseButton1Click:Connect(function()
local pointsToGet = pointTable[shoutNumber.Value]
print(pointsToGet)
rs.Events.Shouted:FireServer(pointsToGet,plr)
end)
any help as to why this is happening is appreciated
btw the module script is nothing much, just 2 values in the table

4 comments
If the problem is in the ModuleScript, why don't you give the code
Also did you sure pointTable is nil and not pointstoGet is nil in the StarterGui script
i didn't give the code to the module script Xapelize because as i said, it's just 2 lines of code that have different values
also the problem is getting the values from the module script, i did it in a local AND server script and both didn't work, they just returned nil