How do I check Module Script Table Variable

I’m a little stupid and have never used a Module Script before as I’m not really into game development and just have fun but I’m working on a project that requires the use of Module Scripts.

Does anyone know how to check if this ‘Table Variable’ is true or false?
image

This is a stupid question but I literally have never used Module Scripts before, sorry!

if type(thing) == 'table' then
  -- do thing
end

I don’t understand?

How does it check if the value is true and false and can you show this example in a real Module Script?

Oh sorry I misread your post.

local Example = require(Path-To-Module)

if Example.Blah.ImBored == true then
  -- do thing
end

weird, not working, am I doing something wrong?

local Robux = {}

Robux.Boredom = {
	
	BoredSquad = true
	
}

if Robux.Boredom.BoredSquad == true then
	Player:Kick('dfsdfasdfadfg')
end

make sure to return it

local Robux = {}

Robux.Boredom = {
	
	BoredSquad = true
	
}

if Robux.Boredom.BoredSquad == true then
	Player:Kick('dfsdfasdfadfg')
end
return Robux -- returns the table so it can be accessed by the scripts that call it

also, are you requiring this module anywhere?
If not insert a normal server script and do so

local Module = require(mouldelocationHere)

Nope, still doesn’t work and I am not requiring this module or anything. I’m just messing around and trying to learn new things for a private project.

My Code :

local Robux = {}

Robux.Boredom = {
	BoredSquad = true
}

if Robux.Boredom.BoredSquad == true then
	game.Players.LocalPlayer:Kick('dfsdfasdfadfg')
end

return Robux

Is player defined anywhere in the script? Like could you show all the code

thats why. module scripts only work if a script is requiring them.
Make a local script inside starter player scripts and do this

local Module = require(mouldelocationHere)

this will make it work and fire

1 Like

That was the issue! Thanks for helping me out!

glad I could help you out!