-
What do you want to achieve?
I am currently trying to program an inventory system using ModuleScipts but the only problem I have is using functions.
I want to make a function that prints out 3 words in order but instead, it ignores the first word and prints it as ‘nil’ -
What is the issue?
The function prints the 2nd word first and prints the first word as ‘nil’.
-- MODULESCRIPT in ServerScriptService
local Functions = {}
function Functions:Print3Words(Word1,Word2,Word3)
print(Word1)
print(Word2)
print(Word3)
end
return Functions
--SCRIPT in ServerScriptService
local Module = require(script.Parent.ModuleScript)
Module.Print3Words('Noob', 'Noob2', 'Milk')
--OUTPUT
Noob2 - Server - ModuleScript:4
Milk - Server - ModuleScript:5
nil - Server - ModuleScript:6
I don’t know what I did wrong here
Why does it ignore the first word and prints it as ‘nil’?