Character
Represents an in-game character, providing properties and methods to control its movement, appearance, and interaction within the game environment.
Properties
Indicates whether the character is currently moving.
local player = client.localPlayer
print(tostring(player.character.isMoving))
Returns the distance from the character to its destination.
local player = client.localPlayer
print(player.character.distanceToDestination)
The target destination of the character in the game world.
local player = client.localPlayer
player.character.destination = Vector3.New(0, 0, 0)
When set to true, the character uses pathfinding to navigate to its destination.
local player = client.localPlayer
player.character.usePathfinding = true
Specifies the rendering layer of the character for drawing order.
local player = client.localPlayer
player.character.renderLayer = 1
The position of the character in the game world for rendering purposes.
local player = client.localPlayer
player.character.renderPosition = Vector3.New(0, 0, 0)
The rotation of the character in the game world for rendering purposes.
local player = client.localPlayer
player.character.renderRotation = Quaternion.New(0, 0, 0, 1)
The scale of the character in the game world for rendering purposes.
local player = client.localPlayer
player.character.renderScale = Vector3.New(1, 1, 1)
Reference to the player object that controls or owns the character.
local player = client.localPlayer
print(player.character.player)
An event that is triggered when the character's state changes.
local player = client.localPlayer
player.character.StateChanged:Connect(function(state)
print("Character state changed to " .. state)
end)
An event that is triggered when the character finishes moving to a destination.
local player = client.localPlayer
player.character.MoveFinished:Connect(function()
print("Character has finished moving.")
end)
An event that is triggered when an animation event occurs on the character.
local player = client.localPlayer
player.character.AnimationEvent:Connect(function(event)
print("Animation event: " .. event)
end)
The current state of the character.
local player = client.localPlayer
print(player.character.state)
The movement speed of the character.
local player = client.localPlayer
player.character.speed = 10
Methods
Teleports the character to a specified position.
local player = client.localPlayer
player.character:Teleport(Vector3.New(0, 0, 0))
Parameters
to
Vector3callback
LuaFunctionReturns
Sets the character to an idle state.
local player = client.localPlayer
player.character:SetIdle()
Returns
Plays a specified emote animation on the character.
local player = client.localPlayer
player.character:PlayEmote("idle-dance-casual")
Parameters
emoteName
The name of the emote to play.
loop
Whether the emote should loop.
callback
LuaFunctionA callback function to execute when the emote playback is complete.
Returns
Moves the character to a specified position.
local player = client.localPlayer
player.character:MoveTo(Vector3.New(0, 0, 0))
Parameters
position
Vector3The target position for the character to move to.
areaMask
An optional mask to specify allowed movement areas.
callback
LuaFunctionA callback function to execute when movement is complete.
Returns
Returns true if movement is successfully initiated.
Moves the character within a specified range of a position.
local player = client.localPlayer
player.character:MoveWithinRangeOf(Vector3.New(0, 0, 0), 5)
Parameters
position
Vector3The target position for the character to approach.
distance
The desired distance from the target position.
areaMask
An optional mask to specify allowed movement areas.
callback
LuaFunctionA callback function to execute when movement is complete.
Returns
Returns true if movement is successfully initiated.
Parameters
anchor
Anchorcallback
LuaFunctionReturns
Parameters
Returns
Smoothly transitions the character's render position from one point to another.
local player = client.localPlayer
player.character:TweenRenderPosition(Vector3.New(0, 0, 0), Vector3.New(10, 0, 0))
Initiates a smooth transition for the character's render position to a specified destination.
local player = client.localPlayer
player.character:TweenRenderPositionTo(Vector3.New(10, 0, 0))
Sets the character's outfit to a specified asset.
Parameters
outfit
CharacterOutfitThe outfit asset to apply to the character.
Returns
Resets the character's outfit to its default appearance.
Returns
Removes the character's current outfit.
Parameters
outfit
CharacterOutfitThe outfit asset to remove from the character.
Returns
Adds an outfit to the character's current appearance.
Parameters
outfit
CharacterOutfitThe outfit asset to add to the character.