Skip to content

How to get Players in an Instance

Getting Player Count

1
2
3
4
5
-- Pull get the number of users in an instance
CVR = require "CVR"
... = CVR.PlayersAPI.PlayerCount
-- You can also use:
... = #CVR.PlayersAPI.AllPlayers

Getting All Players

1
2
3
-- Pull in all the users in an instance, including you.
CVR = require "CVR"
... = CVR.PlayersAPI.AllPlayers

Getting All Remote Players

1
2
3
-- Pull in all the users in an instance, excluding you.
CVR = require "CVR"
... = CVR.PlayersAPI.RemotePlayers

Local Player

1
2
3
-- Get just you.
CVR = require "CVR"
... = CVR.PlayersAPI.LocalPlayer