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?
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:
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)