Old Post
ExpandPlayers Module
Description
The ExpandPlayers module provides a collection of functions that extend the functionality of the Roblox Players service.
Table of Contents
Functions
GetPlayerByName
function ExpandPlayers:GetPlayerByName(name: string): Player?
Returns the player with the given display name, or nil if no player is found.
Parameters
-
name: string
- The display name of the player to look for.
Returns
-
Player?
- The player with the given display name, or nil if no player is found.
TeleportPlayer
function ExpandPlayers:TeleportPlayer(player: Player, position: Vector3): void
Teleports the given player to the specified position.
Parameters
-
player: Player
- The player to teleport. -
position: Vector3
- The position to teleport the player to.
Returns
void
GetPlayerByUserId
function ExpandPlayers:GetPlayerByUserId(userId: number): Player?
Returns the player with the given UserId, or nil if no player is found.
Parameters
-
userId: number
- The UserId of the player to look for.
Returns
-
Player?
- The player with the given UserId, or nil if no player is found.
GetPing
function ExpandPlayers:GetPing(player: Player): number
Returns the ping of the given player, or 0 if the ping cannot be found.
Parameters
-
player: Player
- The player to get the ping of.
Returns
-
number
- The ping of the given player, or 0 if the ping cannot be found.
GetFPS
function ExpandPlayers:GetFPS(player: Player): number
Returns the FPS of the given player, or 0 if the FPS cannot be found.
Parameters
-
player: Player
- The player to get the FPS of.
Returns
-
number
- The FPS of the given player, or 0 if the FPS cannot be found.
GetResolution
function ExpandPlayers:GetResolution(player: Player): Vector2
Returns the GUI resolution of the given player, or Vector2.new(0, 0) if the resolution cannot be found.
Parameters
-
player: Player
- The player to get the GUI resolution of.
Returns
-
Vector2
- The GUI resolution of the given player, or Vector2.new(0, 0) if the resolution cannot be found.
SetWalkspeed
function ExpandPlayers:SetWalkspeed(player: Player, speed: number)
Sets the walkspeed of the given player.
Parameters
-
player: Player
- The player to set the walkspeed of. -
speed: number
- The new walkspeed.
Returns
void
SetJumpPower
function ExpandPlayers:SetJumpPower(player: Player, power: number)
Sets the jump power of the given player.
Parameters
-
player: Player
- The player to set the jump power of. -
power: number
- The new jump power.
Returns
void
CreateBackpack
function ExpandPlayers:CreateBackpack(player: Player)
Creates a new backpack for the given player.
Parameters
-
player: Player
- The player to create the backpack for.
Returns
void
CreateFolder
function ExpandPlayers:CreateFolder(player: Player, folderName: string)
Creates a new folder in the given player’s backpack.
Parameters
-
player: Player
- The player to create the folder for. -
folderName: string
- The name of the new folder.
Returns
void
GetResolution
function ExpandPlayers:GetResolution(player: Player): Vector2
Returns the GUI resolution of the given player, or Vector2.new(0, 0) if the resolution cannot be found.
Parameters
-
player: Player
- The player to get the GUI resolution of.
Returns
-
Vector2
- The GUI resolution of the given player, or Vector2.new(0, 0) if the resolution cannot be found.
SetWalkspeed
function ExpandPlayers:SetWalkspeed(player: Player, speed: number)
Sets the walkspeed of the given player.
Parameters
-
player: Player
- The player to set the walkspeed of. -
speed: number
- The new walkspeed.
Returns
void
SetJumpPower
function ExpandPlayers:SetJumpPower(player: Player, power: number)
Sets the jump power of the given player.
Parameters
-
player: Player
- The player to set the jump power of. -
power: number
- The new jump power.
Returns
void
GetCurrentTool
function ExpandPlayers:GetCurrentTool(player: Player): Tool?
Returns the current tool equipped by the player, or nil if the player has no tool equipped.
Parameters
-
player: Player
- The player to get the current tool of.
Returns
-
Tool?
- The current tool equipped by the player, or nil if the player has no tool equipped.
UnequipCurrentTool
function ExpandPlayers:UnequipCurrentTool(player: Player): void
Unequips the current tool of the player.
Parameters
-
player: Player
- The player to unequip the tool of.
Returns
void
EquipTool
function ExpandPlayers:EquipTool(player: Player, tool: Tool): void
Equips the given tool to the player.
Parameters
-
player: Player
- The player to equip the tool to. -
tool: Tool
- The tool to equip.
Returns
void
CreateBackpackFolder
function ExpandPlayers:CreateBackpackFolder(player: Player, folderName: string): Folder?
Creates a new folder in the player’s backpack and returns it.
Parameters
-
player: Player
- The player to create the folder for. -
folderName: string
- The name of the new folder.
Returns
-
Folder?
- The new folder created.
ClearBackpack
function ExpandPlayers:ClearBackpack(player: Player): void
Removes all tools and items from the player’s backpack.
Parameters
-
player: Player
- The player whose backpack will be cleared.
Returns
void
SetTeam
function ExpandPlayers:SetTeam(player: Player, team: Team): void
Sets the team of the given player.
Parameters
-
player: Player
- The player to set the team of. -
team: Team
- The new team.
Returns
void
GetGamepasses
function ExpandPlayers:GetGamepasses(player: Player): Array<GamepassInfo>
Returns an array of GamepassInfo objects representing the gamepasses owned by the player.
Parameters
-
player: Player
- The player to get the gamepasses of.
Returns
-
Array<GamepassInfo>
- An array of GamepassInfo objects representing the gamepasses owned by the player.
HasGamepass
function ExpandPlayers:HasGamepass(player: Player, gamepassId: number): boolean
Returns true if the player owns the gamepass with the given ID, false otherwise.
Parameters
-
player: Player
- The player to check for gamepass ownership. -
gamepassId: number
- The ID of the gamepass to check for.
Returns
-
boolean
- true if the player owns the gamepass with the given ID, false otherwise.
GetGamepasses
function ExpandPlayers:GetGamepasses(player: Player): Array<GamepassInfo>
Returns an array of GamepassInfo objects representing the gamepasses owned by the player.
Parameters
-
player: Player
- The player to get the gamepasses of.
Returns
-
Array<GamepassInfo>
- An array of GamepassInfo objects representing the gamepasses owned by the player.
HasPlayedGameBefore
function ExpandPlayers:HasPlayedGameBefore(player: Player): boolean
Returns true if the player has played the game before, otherwise it’ll return false.
Parameters
-
player: Player
- The player to check for if they’ve played the game before.
Returns
-
boolean
- true if the player has played the game before, else false.
GetLocalPlayerFormattedTime
function ExpandPlayers:GetLocalPlayerFormattedTime()
Returns the player’s LocalPlayer’s Time Fortmatted.
This function can only be used in LocalScripts.
Parameters
Returns
Download
Releases · DecentAgent/ExpandedPlayers · GitHub
ExampleScript.lua (817 Bytes): An example script placed in ServerScriptService. Chat commands using ExpandedPlayers
Please let me know how ExpandedPlayers might be made better in the future!
16/05/2023 - 21:54 CEST || UPDATE
I hope this message finds you well. I regret to inform you that the project I had been working on has been officially cancelled and subsequently shut down. This decision was made primarily in response to the influx of numerous hate comments and the prevailing perception that the project was being perceived as spam. As someone who values the integrity and cleanliness of this forum, I have ultimately decided to discontinue further updates on this project.
I must acknowledge that in retrospect, the initiation of this endeavour was ill-conceived, and I take full responsibility for the misjudgement in creating it. Recognizing the importance of maintaining a positive and constructive environment within this community, I have chosen to prioritize the preservation of the forum’s reputation and the satisfaction of its members.
Should any of you have any inquiries or require further clarification, please do not hesitate to contact me directly. I am more than willing to address any concerns or questions you may have. Once again, I apologize for any inconvenience caused, and I am grateful for your understanding and support.
Sincerely,
DecentAgent