An extra line in the module disables ALL scripts in the game

Hello everyone. I encountered a problem that completely disables all scripts in the game (they just don’t work, for example, PlayerAdded). Below is a screenshot with part of the code in the module that is to blame for this.
I checked a similar code structure in a clean play, but the same PlayerAdded worked.
I tried changing local to module.creator, but in vain.
Can you explain how this breaks my game and how to fix it?

module.creator = game:GetService("GroupService"):GetGroupInfoAsync(game.CreatorId).Owner.Id

I’ve been messing with it in a new studio project, and I’m not sure what the issue could be. The action is asynchronous, which means it waits for the network to get information from roblox, so maybe that could be the issue?

The line alone looks fine, maybe some other part is causing another issue.

You could try putting that code in a task, and see what happens:

task.spawn(function()
    module.creator = game:GetService("GroupService"):GetGroupInfoAsync(game.CreatorId).Owner.Id
end)
1 Like

What are you trying to do?

Here is how Roblox suggest checking for the creator:

local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
	if game.CreatorType == Enum.CreatorType.User then
		if player.UserId == game.CreatorId then
			print("The place owner has joined the game!")
		end
	elseif game.CreatorType == Enum.CreatorType.Group then
		if player:IsInGroup(game.CreatorId) then
			print("A member of the group that owns the place has joined the game!")
		end
	end
end)
1 Like

How do you think this relates to solving the problem? What if I need the creator of another group?
I think you answered off-topic

You gave very little info to go on.

So, I suggest you give more info.

Idk pcalls too much but try a pcall on that!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.