PlayerMockPlayerServiceUtils
The mock's stand-ins for what the Players service answers: which mock is the local player, and
which mock a userId resolves to. The local-player designation is a tag on the mock itself rather
than Lua module state, so a destroyed mock takes it along.
Use PlayerMock.setMockedLocalPlayer, PlayerMock.getMockedLocalPlayer and PlayerMock.getMockByUserId.
Functions
getPlayerByUserId
Returns the mock in the DataModel whose UserId stand-in matches, or nil. The mock counterpart of
Players:GetPlayerByUserId. Real UserIds are unique; seed mocks the same way, since the first
match wins.
setMockedLocalPlayer
PlayerMockPlayerServiceUtils.setMockedLocalPlayer() → () → ()--
Restores the previous designation. Safe to call more than once.
Returns the disposer that restores the previous designation.