Player

Parameters

name: string

The player's Roblox username

displayName: string

The player's Roblox display name

userId: number

The player's Roblox user ID


Functions

getEntity(): Entity | nil

Returns the entity this player is controlling if one is active.

setScale(scale: number)

Resize player by provided multiplier. For example a scale of 2 would make the player twice as big (default player scale is 1).

registerSpeedMultiplier(id: string, multiplier: number)

Registers a speed multiplier for the player. A multiplier of 1 is equal to normal speed, less than 1 is slower than normal speed, and greater than 1 is faster than normal speed. A multiplier value of 2 would be equivalent to double the normal speed of the player.

The id parameter can be any string you wish to use to reference the multiplier.

registerAdditionalAirJumps(id: string, count: number)

Registers additional air jumps for the player. The default air jump count is 0. Air jumps are jumps performed while already in the air.

The id parameter can be any string you wish to use to reference the registered air jump change.

registerJumpHeightMultiplier(id: string, multiplier: number)

Registers a jump height multiplier for the player. A multiplier of 1 is equal to normal height (2 block high jump), less than 1 is shorter than normal height, and greater than 1 is higher than normal height. A multiplier value of 2 would be equivalent to double the normal jump height of the player.

The id parameter can be any string you wish to use to reference the multiplier.

removeSpeedMultiplier(id: string)

Removes the speed multiplier with the given id from the player.

removeAdditionalAirJumps(id: string)

Removes the additional air jumps with the given id from the player.

removeJumpHeightMultiplier(id: string)

Removes the jump height multiplier with the given id from the player.

Example usage:

-- Set all player speeds to 2 times normal speed for 30 seconds
-- Set all players to have 1 air jump
for i, player in ipairs(PlayerService.getPlayers()) do 
    player:registerSpeedMultiplier("speed-boost", 2)
    player:registerAdditionalAirJumps("bounce", 1)
    task.wait(30)
    player:removeSpeedMultiplier("speed-boost")
end

Last updated