I’m having an error with the social service invite system. The code I’m using works, but throws this long error.
Script (Just an example, but gives the same error as my real script.)
local players = game:GetService("Players")
local socialService = game:GetService("SocialService")
local player = players.LocalPlayer
local function doInvite()
local success, result = pcall(
function()
return socialService:CanSendGameInviteAsync(player)
end
)
if result == true then
socialService:PromptGameInvite(player)
end
end
wait(10)
doInvite()
Output
18:14:15.114 CorePackages.AppTempCommon.LuaChat.Utils.getFriendsActiveGamesPlaceIdsFromUsersPresence:12: attempt to index nil with number - Client - lua-promise:16
18:14:15.160 Unhandled promise rejection:
CorePackages.AppTempCommon.LuaChat.Utils.getFriendsActiveGamesPlaceIdsFromUsersPresence:12: attempt to index nil with number
CorePackages.Packages._Index.lua-promise.lua-promise:82 function new
CorePackages.Packages._Index.lua-promise.lua-promise:222 function andThen
CoreGui.RobloxGui.Modules.Settings.Pages.ShareGame.Thunks.ApiFetchUsersFriends:28
CorePackages.Packages._Index.roblox_rodux.rodux.thunkMiddleware:10
CorePackages.Packages._Index.roblox_rodux.rodux.Store:62
CoreGui.RobloxGui.Modules.Settings.Pages.ShareGame.Thunks.FetchUserFriends:19
CorePackages.Packages._Index.roblox_rodux.rodux.thunkMiddleware:10
CorePackages.Packages._Index.roblox_rodux.rodux.Store:62
CorePackages.Packages._Index.roblox_roact-rodux.roact-rodux.connect:149
CoreGui.RobloxGui.Modules.Settings.Pages.ShareGame.Components.ShareGameContainer:55
CoreGui.RobloxGui.Modules.Settings.Pages.ShareGame.Components.ShareGameContainer:30 function init
CorePackages.Packages._Index.roblox_roact.roact.Component:323 function __mount
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:363 function mountVirtualNode
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:93 function updateChildren
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:119 function updateVirtualNodeWithRenderResult
CorePackages.Packages._Index.roblox_roact.roact.Component:334 function __mount
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:363 function mountVirtualNode
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:93 function updateChildren
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:119 function updateVirtualNodeWithRenderResult
CorePackages.Packages._Index.roblox_roact.roact.Component:334 function __mount
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:363 function mountVirtualNode
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:93 function updateChildren
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:119 function updateVirtualNodeWithRenderResult
CorePackages.Packages._Index.roblox_roact.roact.Component:334 function __mount
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:363 function mountVirtualNode
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:93 function updateChildren
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:111 function updateVirtualNodeWithChildren
CorePackages.Packages._Index.roblox_roact.roact.RobloxRenderer:215 function mountHostNode
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:359 function mountVirtualNode
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:93 function updateChildren
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:119 function updateVirtualNodeWithRenderResult
CorePackages.Packages._Index.roblox_roact.roact.Component:334 function __mount
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:363 function mountVirtualNode
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:93 function updateChildren
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:119 function updateVirtualNodeWithRenderResult
CorePackages.Packages._Index.roblox_roact.roact.Component:334 function __mount
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:363 function mountVirtualNode
CorePackages.Packages._Index.roblox_roact.roact.createReconciler:399 function mountVirtualTree
CoreGui.RobloxGui.Modules.Settings.Pages.ShareGame.InviteToGamePrompt:71 function show
CoreGui.RobloxGui.CoreScripts/InviteToGamePrompt:42
- Client - lua-promise:361
I’ve looked around and found nothing.
Any help would be appreciated. Thanks for reading