I’m attempting to call a function in a ModuleScript. Currently, I’m recieving an error that I’m attempting to call a nil value. The intended outcome is to print Hello World!
.
I have tried to check the spelling several times…? I’m not sure what I’m missing here as this is an extremely basic intended output and I have worked with ModuleScripts many times before.
Module:
local DonationAssetsService = {}
function DonationAssetsService:GetDonationGamepasses(username)
print("Hello World!")
end
function DonationAssetsService:GetDonationAssets(username, subCategoryTable)
print("Hello World!")
end
return DonationAssetsService
Server:
local ServerScriptService = game:GetService("ServerScriptService")
local DonationAssetsService = require(ServerScriptService.DonationAssetsService)
DonationAssetsService:GetDonationGamepasses("BeastyBlake101")
Error:
- local ServerScriptService = game:GetService("ServerScriptService") local DonationAssetsService = require(ServerScriptService.DonationAssetsService) DonationAssetsService:GetDonationGamepasses("BeastyBlake101"):5: attempt to call a nil value