Calling function in module script from same module script

i want to call a function within a module script from the same module script, however its not firing

local lobbyInteract = {}

function lobbyInteract.joining(lobby, player)
	--variables
	local players = game:GetService("Players")
	
	local playerLimit = lobby:GetAttribute("playerLimit")
	local playerAmount = lobby:GetAttribute("playerAmount")
	
	local playerId = player.UserId
	
	local playerIcons = lobby.playerIcons
	
	local thumbnailType = Enum.ThumbnailType.HeadShot
	local thumbnailSize = Enum.ThumbnailSize.Size420x420
	local thumbnail = players:GetUserThumbnailAsync(playerId, thumbnailType, thumbnailSize)
	
	--deny access if lobby is full
	if playerAmount == playerLimit then		
		lobbyInteract.player = player
		
		lobbyInteract.errorMessage = "lobby full"
		
	--allow access if room available
	else
		--update player amount
		playerAmount += 1

		--set correct thumbnail spot to player thumbnail (ignore this ill optimise it later)
		if playerAmount == 1 then
			playerIcons.playerTwo.Image = thumbnail
		elseif playerAmount == 2 then
			playerIcons.playerThree.Image = thumbnail
		else
			playerIcons.playerFour.Image = thumbnail
		end
	end
end

function lobbyInteract.leaving(lobby, player)
    --todo
end

function lobbyInteract.interacted(lobby, player, status)
	if status == "join" then
		lobbyInteract.joining(lobby, player)
	else
		lobbyInteract.leaving(lobby, player)
	end
end

return lobbyInteract

the lobbyInteract.interacted function is being fired, however the lobbyInteract.joining function is not, im not getting any errors either. any ideas?

edit: added comment in script

This is possible. How have you confirmed that lobbyInteract.joining is not running?

1 Like

print statements [character limit]