I’ve recently wrapped my corescript variables within a pcall, but now due to this, it seems to be setting the corescript status as nil, and because of this, it’s preventing a module to run. I’m wondering if it has to do with the fix…
wrapped variables
local blockedUsers = nil
local playerBlocked = nil
local playerUnblocked = nil
local playerFriended = nil
local playerUnfriended = nil
pcall(function()
blockedUsers = SGS:GetCore('GetBlockedUserIds')
playerBlocked = SGS:GetCore('PlayerBlockedEvent')
playerUnblocked = SGS:GetCore('PlayerUnblockedEvent')
playerFriended = SGS:GetCore('PlayerFriendedEvent')
playerUnfriended = SGS:GetCore('PlayerUnfriendedEvent')
end)
the problematic code
guiConnections[#guiConnections + 1] = PS.PlayerAdded:Connect(onPlayerAdded)
guiConnections[#guiConnections + 1] = PS.PlayerRemoving:Connect(onPlayerRemoving)
guiConnections[#guiConnections + 1] = TMS.ChildAdded:Connect(onTeamAdded)
guiConnections[#guiConnections + 1] = TMS.ChildRemoved:Connect(onTeamRemoved)
guiConnections[#guiConnections + 1] = playerBlocked.Event:Connect(function(blockedPlayer)
local pData = playerData[find(playerData, blockedPlayer)]
blockedUsers[#blockedUsers + 1] = blockedPlayer.UserId