Is there a way in a module script function to print one of the 2 strings?

I’m new to module scripts but here’s the question:
Is there a way in a module script function to print one of the 2 strings?
Example wants to print only the first sting and not the second.

Module Script:

local module = {}

local function test()

return module


local module = require(script.Parent.ModuleScript)

function module:test()
    if math.random() > 0.5 then

This implementation will PRNG a float in the range [0, 1), and based on what number is generated, it’ll either print 1 or 2. Basically, it’ll do a coin toss and pick one to print based on what it gets.

Don’t want to come off as rude, but how much programming experience do you have? I think you might want to take a step back and go over fundamental programming concepts first before trying to create a project.


First, you have to do function, not local function or else it won’t work. You can have a parameter for the string you want to print and print that that way.

1 Like

I know how to do it around so I thought it wouldn’t be right

That was my mistake, but thanks

I’m not creating a project but just testing my skills.
However, sometimes I don’t think of all the possibilities as in this case.

Fair enough.

Just concerned that you might be biting off more than you can chew, since I see plenty of people with the enthusiasm to make a game, only to turn around and get stuck by simple programming problems because they think they can get good enough at Lua to program a game in a single day.

1 Like

I agree that I am not like that (without being enthusiastic about doing something), but I don’t think about all the possibilities, I may even know what to do but since I don’t think about everything, it is the result of being like that.