From 446ad0e354afafe38580e296233554c8701ea02f Mon Sep 17 00:00:00 2001 From: StarManTheGamer <68450308+StarManTheGamer@users.noreply.github.com> Date: Thu, 28 Dec 2023 22:22:50 -0600 Subject: [PATCH] Deployed e53073f with MkDocs version: 1.5.3 --- objects/effects/Sound/index.html | 140 +++++++++ objects/game/Environment/index.html | 133 ++++++++ objects/system/DynamicInstance/index.html | 100 +++++- objects/world/MeshPart/index.html | 360 ++++++++++++++++++++++ objects/world/NPC/index.html | 237 ++++++++------ search/search_index.json | 2 +- sitemap.xml.gz | Bin 127 -> 127 bytes 7 files changed, 877 insertions(+), 95 deletions(-) diff --git a/objects/effects/Sound/index.html b/objects/effects/Sound/index.html index df090da8..7cc4ae28 100755 --- a/objects/effects/Sound/index.html +++ b/objects/effects/Sound/index.html @@ -1286,6 +1286,63 @@
The event that is fired when the sound is loaded from the server.
+Example +
sound.Loaded:Connect(function()
+ sound.Play()
+end)
+
void
¶Plays the sound.
+void
¶Stops playing the sound.
void
¶Creates a deadly explosion killing players and applying force to parts at the given position.
+Example +
game["Environment"]:CreateExplosion(Vector3.New(0, 0, 0), 30, 5000, false)
+
When set to true, AffectAnchored will unanchor parts within the explosion radius.
+Callback gets called for each part within explosion radius.
+RayResult
¶Casts a ray from origin with a specified direction and returns a RayResult for the first hit object.
+Example +
local hit = game["Environment"]:Raycast(barrel.Position, barrel.Forward)
+
+if hit and hit.Instance:IsA("Player") then
+ hit.Instance.Health = 0
+end
+
RayResult[]
¶Casts a ray from origin with a specified direction and returns a RayResult array for all hit objects.
+Example +
local hits = game["Environment"]:RaycastAll(Vector3.New(0, 10, 0), Vector3.New(0, -1, 0), 100)
+
+for i, hit in pairs(hits) do
+ print("Hit at " .. hit.Position .. "!")
+end
+
void
¶Rotates the DynamicInstance so that the forward vector looks at the target.
+Example +
part.LookAt(Vector3.New(12, 34, 56))
+
void
¶Moves the transform in the direction and distance of translation.
+Example +
part.Translate(part.Forward * 5)
+
Gets triggered when the NPC dies.
+Example +
game["Environment"]["NPC"].Died:Connect(function ()
+ print("NPC died!")
+end)
+
void
¶Loads the specified user ID's avatar on the NPC.
+Example +
-- Loads the appearance of willemsteller
+npc:LoadAppearance(2)
+
void
¶Clears the NPC's appearance.
+Example +
-- Clears the appearance of the NPC
+npc:ClearAppearance()
+
Specifies the color of the NPC's torso.
-void
¶Loads the specified user ID's avatar on the NPC.
-Example -
-- Loads the appearance of willemsteller
-npc:LoadAppearance(2)
-
void
¶Clears the NPC's appearance.
-Example -
-- Clears the appearance of the NPC
-npc:ClearAppearance()
-
Welcome to the Polytoria Scripting API documentation! This documentation provides up-to-date information on creating your experiences on Polytoria using scripting.
Polytoria uses the\u00a0Lua programming language. If you are unfamiliar with Lua, you can find the documentation here
"},{"location":"#contributing-to-our-docs","title":"Contributing to our docs","text":"The entire documentation is open source; you can access it right now!
You can contribute to our documenting efforts by creating a pull request on our GitHub repository. Feel free to add working examples or clarifications where needed.
"},{"location":"#credits","title":"Credits","text":"The Polytoria Scripting documentation site is powered by Material for MkDocs. If you are having any issues with the site, consider contributing to the Material for MkDocs project.
"},{"location":"objects/effects/","title":"Effects & Utilities","text":""},{"location":"objects/effects/Accessory/","title":"Accessory","text":""},{"location":"objects/effects/Animator/","title":"Animator","text":""},{"location":"objects/effects/BodyPart/","title":"BodyPart","text":""},{"location":"objects/effects/Decal/","title":"Decal","text":"Decals are objects that can have an image texture and are placed in the world.
"},{"location":"objects/effects/Decal/#properties","title":"Properties","text":""},{"location":"objects/effects/Decal/#ImageID","title":"ImageID :number
","text":"Specifies the image asset ID of the decal.
Example
game[\"Environment\"][\"Decal\"].ImageID = 11643\n
"},{"location":"objects/effects/Light/","title":"Light","text":""},{"location":"objects/effects/PointLight/","title":"PointLight","text":"PointLight is a source of light that can be placed in the world.
"},{"location":"objects/effects/PointLight/#properties","title":"Properties","text":""},{"location":"objects/effects/PointLight/#Brightness","title":"Brightness :number
","text":"Specifies how bright/intense the light is.
"},{"location":"objects/effects/PointLight/#Color","title":"Color : Color","text":"Specifies the color of the light.
"},{"location":"objects/effects/PointLight/#Range","title":"Range :number
","text":"Specifies how far out the light can reach.
"},{"location":"objects/effects/PointLight/#Shadows","title":"Shadows :boolean
","text":"Specifies whether this light emits shadows or not.
Shadows
Having many lights with shadows enabled will cause a massive hit in performance. Consider minimzing the amount of lights with shadows to ensure every player is enjoying your game with minimal framerate issues.
"},{"location":"objects/effects/Sound/","title":"Sound","text":"Sounds are objects that can be placed in the world and that emit audio.
"},{"location":"objects/effects/Sound/#properties","title":"Properties","text":""},{"location":"objects/effects/Sound/#Autoplay","title":"Autoplay :boolean
","text":"Determines whether the sound should start playing automatically.
"},{"location":"objects/effects/Sound/#Length","title":"Length :number
","text":"Returns the length of the currently loaded audio
"},{"location":"objects/effects/Sound/#Loop","title":"Loop :boolean
","text":"Determines whether the sound should loop or not.
"},{"location":"objects/effects/Sound/#Pitch","title":"Pitch :number
","text":"The pitch property of this sound
"},{"location":"objects/effects/Sound/#PlayInWorld","title":"PlayInWorld :boolean
","text":"When enabled, the sound will be played in 3D world space rather than having the same volume for everyone.
"},{"location":"objects/effects/Sound/#Playing","title":"Playing :boolean
","text":"Determines whether the sound is currently playing or not.
"},{"location":"objects/effects/Sound/#Size","title":"Size :Vector3
","text":"Property description (what?? change this later)
"},{"location":"objects/effects/Sound/#SoundID","title":"SoundID :number
","text":"The asset ID of the sound.
"},{"location":"objects/effects/Sound/#Time","title":"Time :number
","text":"The time position the track is currently on.
"},{"location":"objects/effects/Sound/#Volume","title":"Volume :number
","text":"The volume of the sound.
"},{"location":"objects/effects/SpotLight/","title":"SpotLight","text":""},{"location":"objects/enums/","title":"Enums","text":""},{"location":"objects/enums/AmbientSource/","title":"AmbientSource","text":"Name Value DescriptionAmbientSource.Skybox
0 Ambient light is taken from the sky AmbientSource.AmbientColor
1 Ambient light is taken from the Lighting.AmbientColor
property"},{"location":"objects/enums/CameraMode/","title":"CameraMode","text":"Name Description CameraMode.Scripted
Camera is able to be controlled by scripts CameraMode.FollowPlayer
Camera is controlled by the player (default)
CameraMode.FreeCam
Camera is able to be freely moved by the player"},{"location":"objects/enums/PartMaterial/","title":"PartMaterial","text":"Name Value PartMaterial.SmoothPlastic
0 PartMaterial.Wood
1 PartMaterial.Concrete
2 PartMaterial.Neon
3 PartMaterial.Metal
4 PartMaterial.Brick
5 PartMaterial.Grass
6 PartMaterial.Dirt
7 PartMaterial.Stone
8 PartMaterial.Snow
9 PartMaterial.Ice
10 PartMaterial.RustyIron
11 PartMaterial.Sand
12 PartMaterial.Sandstone
13 PartMaterial.Plastic
14 PartMaterial.Plywood
15 PartMaterial.Planks
16"},{"location":"objects/enums/PartShape/","title":"PartShape","text":"Name Value PartShape.Ball
0 PartShape.Brick
1 PartShape.Cylinder
2 PartShape.Wedge
3 PartShape.Truss
4 PartShape.TrussFrame
5 PartShape.Bevel
6 PartShape.QuarterPipe
7"},{"location":"objects/enums/SkyboxPreset/","title":"SkyboxPreset","text":"Name Value Description SkyboxPreset.Day1
0 A blue sky with clouds SkyboxPreset.Day2
1 A blue sky with clouds SkyboxPreset.Day3
2 A blue sky with clouds SkyboxPreset.Day4
3 A blue sky with clouds SkyboxPreset.Day5
4 A blue sky with clouds SkyboxPreset.Day6
5 A blue sky with clouds SkyboxPreset.Day7
6 A blue sky with clouds SkyboxPreset.Morning1
7 A morning sky with clouds SkyboxPreset.Morning2
8 A morning sky with clouds SkyboxPreset.Morning3
9 A morning sky with clouds SkyboxPreset.Morning4
10 A morning sky with clouds SkyboxPreset.Night1
11 A night sky with stars SkyboxPreset.Night2
12 A night sky with stars SkyboxPreset.Night3
13 A night sky with stars SkyboxPreset.Night4
14 A night sky with stars SkyboxPreset.Night5
15 A night sky with stars SkyboxPreset.Sunset1
16 A dusk, red sky with clouds SkyboxPreset.Sunset2
17 A dusk, red sky with clouds SkyboxPreset.Sunset3
18 A dusk, red sky with clouds SkyboxPreset.Sunset4
19 A dusk, red sky with clouds SkyboxPreset.Sunset5
20 A dusk, red sky with clouds"},{"location":"objects/enums/TextFontPreset/","title":"TextFontPreset","text":""},{"location":"objects/enums/TextFontPreset/#textfontpreset","title":"TextFontPreset","text":"Name SourceSans
PressStart2P
Montserrat
RobotoMono
Rubik
Poppins
Domine
Fredoka
ComicNeue
Orbitron
"},{"location":"objects/enums/TextJustify/","title":"TextJustify","text":"NameTextJustify.Left
TextJustify.Center
TextJustify.Right
TextJustify.Justify
TextJustify.Flush
"},{"location":"objects/enums/TextVerticalAlign/","title":"TextVerticalAlign","text":"Name TextVerticalAlign.Top
TextVerticalAlign.Middle
TextVerticalAlign.Button
"},{"location":"objects/enums/TweenStyle/","title":"TweenStyle","text":"Name easeInBack easeInBounce easeInCirc easeInCubic easeInElastic easeInExpo easeInOutBack easeInOutBounce easeInOutCirc easeInOutCubic easeInOutElastic easeInOutExpo easeInOutQuad easeInOutQuart easeInOutQuint easeInOutSine easeInQuad easeInQuart easeInQuint easeInSine easeOutBack easeOutBounce easeOutCirc easeOutCubic easeOutElastic easeOutExpo easeOutQuad easeOutQuart easeOutQuint easeOutSine linear punch"},{"location":"objects/game/","title":"Game","text":""},{"location":"objects/game/Backpack/","title":"Backpack","text":"Backpack is a child of player used for storing tools.
"},{"location":"objects/game/Camera/","title":"Camera","text":"This is only available to the client. It can only be accessed within local scripts.
Camera is the local player's camera.
"},{"location":"objects/game/Camera/#properties","title":"Properties","text":""},{"location":"objects/game/Camera/#Distance","title":"Distance :number
","text":"The distance between the camera and the player when the camera is in FollowPlayer mode.
"},{"location":"objects/game/Camera/#FOV","title":"FOV :number
","text":"Sets or return the camera's field of view.
"},{"location":"objects/game/Camera/#FastFlySpeed","title":"FastFlySpeed :number
","text":"The camera speed when the camera is in FreeCam mode while holding shift.
"},{"location":"objects/game/Camera/#FastFlySpeed","title":"FastFlySpeed :number
","text":"The camera speed when the camera is in FreeCam mode.
"},{"location":"objects/game/Camera/#FollowLerp","title":"FollowLerp :boolean
","text":"Determines whether or not to use lerping in FollowPlayer mode.
"},{"location":"objects/game/Camera/#FreeLookSensitivity","title":"FreeLookSensitivity :number
","text":"The mouse sensitivity while in FreeCam mode.
"},{"location":"objects/game/Camera/#HorizontalSpeed","title":"HorizontalSpeed :number
","text":"The horizontal movement speed of the camera in FollowPlayer mode.
"},{"location":"objects/game/Camera/#IsFirstPerson","title":"IsFirstPerson :boolean
","text":"Returns whether or not the camera is in first person.
This property is read-only and cannot be modified.
"},{"location":"objects/game/Camera/#LerpSpeed","title":"LerpSpeed :number
","text":"The lerp speed of the camera when lerping is enabled.
"},{"location":"objects/game/Camera/#MaxDistance","title":"MaxDistance :number
","text":"The camera's maximum distance from the player in FollowPlayer mode.
"},{"location":"objects/game/Camera/#MinDistance","title":"MinDistance :number
","text":"The camera's minimum distance from the player in FollowPlayer mode.
"},{"location":"objects/game/Camera/#Mode","title":"Mode : :polytoria-CameraMode: CameraMode","text":"Sets or returns the camera's current mode.
"},{"location":"objects/game/Camera/#Orthographic","title":"Orthographic :boolean
","text":"Determines whether or not the camera should render in orthographic (2D) mode or not (3D).
"},{"location":"objects/game/Camera/#OrthographicSize","title":"OrthographicSize :number
","text":"Determines the half-size of the camera when in orthographic mode.
"},{"location":"objects/game/Camera/#ScrollSensitivity","title":"ScrollSensitivity :number
","text":"Determines the scroll move speed of the camera.
"},{"location":"objects/game/Camera/#VerticalSpeed","title":"VerticalSpeed :number
","text":"Determines the vertical move speed of the camera.
"},{"location":"objects/game/Environment/","title":"Environment","text":"Environment is the primary object intended for storing active objects in the game.
"},{"location":"objects/game/Environment/#properties","title":"Properties","text":""},{"location":"objects/game/Environment/#FogColor","title":"FogColor : Color","text":"The color of the fog. Fog is a visual effect that makes the world look like it is covered in a colored mist.
Example
Change the fog color to white:
game[\"Environment\"].FogColor = Color.New(1, 1, 1, 1)\n
"},{"location":"objects/game/Environment/#FogEnabled","title":"FogEnabled : boolean
","text":"Whether or not fog is enabled.
"},{"location":"objects/game/Environment/#FogStartDistance","title":"FogStartDistance :number
","text":"The distance from the camera at which fog starts to appear
"},{"location":"objects/game/Environment/#FogEndDistance","title":"FogEndDistance :number
","text":"The distance from the camera at which fog is fully opaque
"},{"location":"objects/game/Environment/#Gravity","title":"Gravity :Vector3
= Vector3.New(0, -75, 0)
","text":"The direction and strength of gravity in the world
"},{"location":"objects/game/Environment/#Skybox","title":"Skybox : :polytoria-SkyboxPreset: SkyboxPreset","text":"The default skybox preset to use for the world, if no ImageSky is present.
"},{"location":"objects/game/Game/","title":"Game","text":"Game is the root object in the Polytoria instance tree. It is the object of which everything is descended
"},{"location":"objects/game/Game/#properties","title":"Properties","text":""},{"location":"objects/game/Game/#GameID","title":"GameID :number
","text":"The ID of the current Polytoria place.
The value is 0
when testing locally through Polytoria Creator, which can be used as a conditional to check if the game is live or not.
number
","text":"The total number of instances currently loaded
Remarks
The value will differ depending on if it is being accessed through a Script or a LocalScript, as LocalScripts can only see instances that are relevant to the client.
"},{"location":"objects/game/Game/#events","title":"Events","text":""},{"location":"objects/game/Game/#Rendered","title":"Rendered","text":"Called every frame after the game has been rendered
Notice
The server is incapable of rendering frames; rather, on server Scripts, the event will fire at the server's tick rate which may vary between 1-30Hz.
It is recommended to only listen to this event on LocalScripts.
"},{"location":"objects/game/Hidden/","title":"Hidden","text":"Hidden is a service used for hiding instances.
"},{"location":"objects/game/Lighting/","title":"Lighting","text":"Lighting is responsible for controlling the state of the lighting in the place. It provides many different options for creators to enhance and fine-tune the visuals of their worlds.
By parenting an ImageSky object to Lighting, you can change the skybox of the world.
"},{"location":"objects/game/Lighting/#properties","title":"Properties","text":""},{"location":"objects/game/Lighting/#AmbientColor","title":"AmbientColor : Color","text":"The color of the ambient light. Ambient light is light that is not coming from any particular direction, and is used to simulate light bouncing off of surfaces.
This property is only used if AmbientSource is set to AmbientSource.AmbientColor
.
The source of the ambient light
"},{"location":"objects/game/Lighting/#SunBrightness","title":"SunBrightness :number
","text":"The brightness of the sun
"},{"location":"objects/game/Lighting/#SunColor","title":"SunColor : Color","text":"The color of the sun. This affects the color of the ambient lighting in the environment.
"},{"location":"objects/game/Lighting/#Shadows","title":"Shadows :boolean
","text":"Whether or not shadows are enabled
"},{"location":"objects/game/Player/","title":"Player","text":"Not to be confused with:
Players (the service object that contains all connected players.)
PlayerAvatar (the avatar)
Player is the class of the player and it's character controlled by it's player.
"},{"location":"objects/game/Player/#properties","title":"Properties","text":""},{"location":"objects/game/Player/#CanMove","title":"CanMove :boolean
= true
","text":"Determines whether or not the player can move.
"},{"location":"objects/game/Player/#ChatColor","title":"ChatColor : Color =(255,255,255)
","text":"The player's username color in the chat.
game[\"Players\"][\"willemsteller\"].ChatColor = Color3.New(0, 1, 0)\n
"},{"location":"objects/game/Player/#Health","title":"Health : number
= 100
","text":"The current health of the player.
"},{"location":"objects/game/Player/#IsAdmin","title":"IsAdmin :boolean
","text":"Returns whether or not the player is a Polytoria admin.
This property is read-only and cannot be modified.
"},{"location":"objects/game/Player/#IsCreator","title":"IsCreator :boolean
","text":"Returns whether or not the player is the creator of the current game.
This property is read-only and cannot be modified.
"},{"location":"objects/game/Player/#IsInputFocused","title":"IsInputFocused :boolean
","text":"Determines whether or not the player is currently focused on an input.
"},{"location":"objects/game/Player/#JumpPower","title":"JumpPower :number
= 36
","text":"Specifies how high the player's jump is.
"},{"location":"objects/game/Player/#MaxHealth","title":"MaxHealth :number
= 100
","text":"Specifies the maximum health the player can have.
"},{"location":"objects/game/Player/#MaxStamina","title":"MaxStamina :number
= 3
","text":"Specifies the maximum stamina the player can have.
"},{"location":"objects/game/Player/#RespawnTime","title":"RespawnTime :number
= 5
","text":"Determines how long it takes between the player's death and respawn.
"},{"location":"objects/game/Player/#SittingIn","title":"SittingIn : Seat","text":"Returns the seat the player is currently sitting in, nil
if the player is not sitting in any seat.
number
= 25
","text":"Determines how fast the player is while sprinting.
Remarks
Sprinting can be disabled by setting the player's SprintSpeed to their WalkSpeed.
"},{"location":"objects/game/Player/#Stamina","title":"Stamina :number
= 0
","text":"The player's current amount of stamina.
"},{"location":"objects/game/Player/#StaminaEnabled","title":"StaminaEnabled :boolean
= true
","text":"Determines whether or not stamina is enabled for the player.
"},{"location":"objects/game/Player/#StaminaRegen","title":"StaminaRegen :number
= 1.2
","text":"The rate at which stamina regenerates after being depleted for the player.
"},{"location":"objects/game/Player/#UserID","title":"UserID :number
","text":"Returns the player's user ID.
This property is read-only and cannot be modified.
"},{"location":"objects/game/Player/#WalkSpeed","title":"WalkSpeed :number
= 16
","text":"Determines how fast the player walks.
"},{"location":"objects/game/Player/#events","title":"Events","text":""},{"location":"objects/game/Player/#Chatted","title":"Chatted :string
","text":"Fires when the player sends a chat message.
Example
game[\"Players\"][\"willemsteller\"].Chatted:Connect(function (message)\n print(\"Player wrote: \" .. message)\nend)\n
"},{"location":"objects/game/Player/#Died","title":"Died","text":"Fires when the player dies.
Example
game[\"Players\"][\"willemsteller\"].Died:Connect(function ()\n print(\"Player died\")\nend)\n
"},{"location":"objects/game/Player/#Respawned","title":"Respawned","text":"Fires when the player respawns.
Example
game[\"Players\"][\"willemsteller\"].Respawned:Connect(function ()\n print(\"Player has respawned\")\nend)\n
"},{"location":"objects/game/Player/#methods","title":"Methods","text":""},{"location":"objects/game/Player/#DropTools","title":"DropTools \u2192 void
","text":"Drops the tool the player is currently holding.
This is only available to the server. It can only be accessed within server scripts.
"},{"location":"objects/game/Player/#Kick","title":"Kick \u2192void
","text":"Kicks the player from the server.
This is only available to the server. It can only be accessed within server scripts.
"},{"location":"objects/game/Player/#OwnsItem","title":"OwnsItem \u2192callback
","text":"Checks if the player owns an item
Caching
The function will cache the result for 5 minutes.
Rate Limit
A maximum of 30 requests can be made per minute per server.
Example
player:OwnsItem(11117, function(error, owns)\n if error then\n print(\"An error occurred!\")\n else\n if owns then\n print(\"Player owns Blade of Spooks!\")\n else\n print(\"Player does not own Blade of Spooks!\")\n end\n end\nend)\n
"},{"location":"objects/game/Player/#Respawn","title":"Respawn \u2192 void
","text":"Respawns the player.
"},{"location":"objects/game/Player/#Sit","title":"Sit \u2192Seat
","text":"Sit the player in a specific seat.
"},{"location":"objects/game/Player/#Unsit","title":"Unsit \u2192bool=false
","text":"Unsit the player.
"},{"location":"objects/game/PlayerAvatar/","title":"PlayerAvatar","text":"This currently doesn't exist but has been promised by Polytoria developers.
Not to be confused with:
Players (the service object that contains all connected players.)
Player (the object that represents a single player.)
PlayerAvatar is a class that represents the player's avatar in game.
"},{"location":"objects/game/PlayerDefaults/","title":"PlayerDefaults","text":"PlayerDefaults is a service used for storing the default values of the Player when created.
"},{"location":"objects/game/PlayerDefaults/#properties","title":"Properties","text":""},{"location":"objects/game/PlayerDefaults/#ChatColor","title":"ChatColor : Color =(255,255,255)
","text":"Determines the default color of players' usernames in chat.
"},{"location":"objects/game/PlayerDefaults/#JumpPower","title":"JumpPower :number
= 36
","text":"Determines how high the player jumps by default.
"},{"location":"objects/game/PlayerDefaults/#MaxHealth","title":"MaxHealth :number
= 100
","text":"Determines the default maximum health of players.
"},{"location":"objects/game/PlayerDefaults/#MaxStamina","title":"MaxStamina :number
= 3
","text":"Determines the default maximum stamina of players.
"},{"location":"objects/game/PlayerDefaults/#RespawnTime","title":"RespawnTime :number
= 5
","text":"Determines the default of how long it takes between player's death and respawn.
"},{"location":"objects/game/PlayerDefaults/#SprintSpeed","title":"SprintSpeed :number
= 25
","text":"Determines the default sprint speed of players.
"},{"location":"objects/game/PlayerDefaults/#Stamina","title":"Stamina :number
= 0
","text":"Determines the default stamina of players.
"},{"location":"objects/game/PlayerDefaults/#StaminaEnabled","title":"StaminaEnabled :boolean
= true
","text":"Determines whether or not stamina is enabled by default for players.
"},{"location":"objects/game/PlayerDefaults/#StaminaRegen","title":"StaminaRegen :number
= 1.2
","text":"Determines the default rate at which stamina regenerates after being depleted for players.
"},{"location":"objects/game/PlayerDefaults/#WalkSpeed","title":"WalkSpeed :number
= 16
","text":"Determines how fast the player walks by default.
"},{"location":"objects/game/PlayerDefaults/#methods","title":"Methods","text":""},{"location":"objects/game/PlayerDefaults/#LoadDefaults","title":"LoadDefaults \u2192void
","text":"Resets the specified player back to their default values.
"},{"location":"objects/game/Players/","title":"Players","text":"Not to be confused with Player, the object that represents a single player.
Players is the container class for all Player instances.
"},{"location":"objects/game/Players/#properties","title":"Properties","text":""},{"location":"objects/game/Players/#LocalPlayer","title":"LocalPlayer : Player","text":"Returns the local player currently playing.
This is only available to the client. It can only be accessed within local scripts.
"},{"location":"objects/game/Players/#PlayerCollisionEnabled","title":"PlayerCollisionEnabled :boolean
","text":"Determines whether or not collisions between players are enabled.
"},{"location":"objects/game/Players/#events","title":"Events","text":""},{"location":"objects/game/Players/#PlayerAdded","title":"PlayerAdded :Player
","text":"Fires when a player joins the server.
"},{"location":"objects/game/Players/#PlayerRemoved","title":"PlayerRemoved :Player
","text":"Fires when a player leaves the server.
"},{"location":"objects/game/Players/#methods","title":"Methods","text":""},{"location":"objects/game/Players/#GetPlayer","title":"GetPlayer \u2192Player
","text":"Returns the player instance from their username.
"},{"location":"objects/game/Players/#GetPlayerByID","title":"GetPlayerByID \u2192Player
","text":"Returns the player instance from their user ID.
"},{"location":"objects/game/Players/#GetPlayers","title":"GetPlayers \u2192[]
","text":"Returns all players in the game as an array.
"},{"location":"objects/game/ScriptService/","title":"ScriptService","text":"ScriptService is a service used for storing scripts and local scripts.
"},{"location":"objects/physics/","title":"Physics","text":""},{"location":"objects/physics/BallSocketJoint/","title":"BallSocketJoint","text":""},{"location":"objects/physics/BodyPosition/","title":"BodyPosition","text":"BodyPosition are objects that apply a force to their parent until it moves toward the target position.
"},{"location":"objects/physics/BodyPosition/#properties","title":"Properties","text":""},{"location":"objects/physics/BodyPosition/#AcceptableDistance","title":"AcceptableDistance :number
","text":"Determines how close the body has to be to the target position to stop applying forces to it.
"},{"location":"objects/physics/BodyPosition/#Force","title":"Force :number
","text":"Determines how much force the body applies.
"},{"location":"objects/physics/BodyPosition/#TargetPosition","title":"TargetPosition :Vector3
","text":"Determines the target position that the body applies forces to get to.
"},{"location":"objects/scripting/","title":"Scripting","text":""},{"location":"objects/scripting/BaseScript/","title":"BaseScript","text":"Not to be confused with:
Script (which runs your Lua scripts on the server.)
LocalScript (which runs your Lua scripts on the client.)
void
","text":"Calls a function on another script
Example
game[\"ScriptService\"][\"Script\"]:Call(\"Foo\", \"Bar\")\n
Local Functions
Local Functions cannot be ran using the Call function.
"},{"location":"objects/scripting/BoolValue/","title":"BoolValue","text":"BoolValue is a ValueBase that stores a boolean.
"},{"location":"objects/scripting/BoolValue/#properties","title":"Properties","text":""},{"location":"objects/scripting/BoolValue/#Value","title":"Value :boolean
","text":"The value of this object.
"},{"location":"objects/scripting/ColorValue/","title":"ColorValue","text":"ColorValue is a ValueBase that stores color.
"},{"location":"objects/scripting/ColorValue/#properties","title":"Properties","text":""},{"location":"objects/scripting/ColorValue/#Value","title":"Value : Color","text":"The value of this object.
"},{"location":"objects/scripting/InstanceValue/","title":"InstanceValue","text":"InstanceValue is a ValueBase that stores an instance.
"},{"location":"objects/scripting/InstanceValue/#properties","title":"Properties","text":""},{"location":"objects/scripting/InstanceValue/#Value","title":"Value : Instance","text":"The value of this object.
"},{"location":"objects/scripting/IntValue/","title":"IntValue","text":"IntValue is a ValueBase that stores integers.
"},{"location":"objects/scripting/IntValue/#properties","title":"Properties","text":""},{"location":"objects/scripting/IntValue/#Value","title":"Value :Int32
","text":"The value of this object.
"},{"location":"objects/scripting/LocalScript/","title":"LocalScript","text":"Local Script is a script that runs locally for each player. It can only see what the player can see.
"},{"location":"objects/scripting/NetworkEvent/","title":"NetworkEvent","text":"NetworkEvents are events that can be called to communicate between server and client.
"},{"location":"objects/scripting/NetworkEvent/#events","title":"Events","text":""},{"location":"objects/scripting/NetworkEvent/#InvokedClient","title":"InvokedClient :Sender=nil
, NetMessage
","text":"Fires when the client receives a message from the server.
Example
netEvent.InvokedClient:Connect(function (sender, message)\n local value = message:GetString(\"key\")\nend)\n
This is only available to the client. It can only be accessed within local scripts.
"},{"location":"objects/scripting/NetworkEvent/#InvokedServer","title":"InvokedServer :Sender=Player
, NetMessage
","text":"Fires when the server receives a message from the client.
Example
netEvent.InvokedServer:Connect(function (sender, message)\n local value = message:GetString(\"key\")\nend)\n
This is only available to the server. It can only be accessed within server scripts.
"},{"location":"objects/scripting/NetworkEvent/#methods","title":"Methods","text":""},{"location":"objects/scripting/NetworkEvent/#InvokeClient","title":"InvokeClient \u2192void
","text":"Sends a network event to a specific player from the server.
Example
local message = NetMessage.New()\nmessage.AddString(\"key\", \"value\")\nnetEvent.InvokeClient(message, game[\"Players\"][\"willemsteller\"])\n
This is only available to the server. It can only be accessed within server scripts.
"},{"location":"objects/scripting/NetworkEvent/#InvokeClients","title":"InvokeClients \u2192void
","text":"Sends a network event to all players from the server.
Example
local message = NetMessage.New()\nmessage.AddString(\"key\", \"value\")\nnetEvent.InvokeClients(message)\n
This is only available to the server. It can only be accessed within server scripts.
"},{"location":"objects/scripting/NumberValue/","title":"NumberValue","text":"NumberValue is a ValueBase that stores numbers.
"},{"location":"objects/scripting/NumberValue/#properties","title":"Properties","text":""},{"location":"objects/scripting/NumberValue/#Value","title":"Value :number
","text":"The value of this object.
"},{"location":"objects/scripting/Script/","title":"Script","text":"Script runs Lua scripts on the server.
"},{"location":"objects/scripting/StringValue/","title":"StringValue","text":"StringValue is a ValueBase that stores strings.
"},{"location":"objects/scripting/StringValue/#properties","title":"Properties","text":""},{"location":"objects/scripting/StringValue/#Value","title":"Value :string
","text":"The value of this object.
"},{"location":"objects/scripting/ValueBase/","title":"ValueBase","text":"Not to be confused with:
BoolValue (used for storing bool values.)
ColorValue (used for storing color values.)
InstanceValue (used for storing instances.)
IntValue (used for storing integer values.)
NumberValue (used for storing number values.)
StringValue (used for storing string values.)
Vector2Value (used for storing Vector2 values.)
Vector3Value (used for storing Vector3 values.)
Fires when the value of the ValueBase changes.
"},{"location":"objects/scripting/Vector2Value/","title":"Vector2Value","text":"Vector2Value is a ValueBase that stores Vector2.
"},{"location":"objects/scripting/Vector2Value/#properties","title":"Properties","text":""},{"location":"objects/scripting/Vector2Value/#Value","title":"Value :Vector2
= (5, 10)
","text":"The value of this object.
"},{"location":"objects/scripting/Vector3Value/","title":"Vector3Value","text":"This object can be used for storing Vector3 values.
"},{"location":"objects/scripting/Vector3Value/#properties","title":"Properties","text":""},{"location":"objects/scripting/Vector3Value/#Value","title":"Value :Vector3
= (5, 123, 10)
","text":"The value of this object.
"},{"location":"objects/system/","title":"System","text":""},{"location":"objects/system/DynamicInstance/","title":"DynamicInstance","text":"DynamicInstance is the base class where all objects with a position, rotation and scale derive from.
"},{"location":"objects/system/DynamicInstance/#properties","title":"Properties","text":""},{"location":"objects/system/DynamicInstance/#Forward","title":"Forward :Vector3
","text":"The forward vector of this DynamicInstance
"},{"location":"objects/system/DynamicInstance/#LocalPosition","title":"LocalPosition :Vector3
= Vector3.New(0, 10, 0)
","text":"Specifies the position relative to the parent of an instance.
"},{"location":"objects/system/DynamicInstance/#LocalRotation","title":"LocalRotation :Vector3
= Vector3.New(0, 45, 0)
","text":"Specifies the rotation relative to the parent of an instance.
Rotation is in euler angles.
"},{"location":"objects/system/DynamicInstance/#LocalSize","title":"LocalSize :Vector3
= Vector3.New(1, 1, 1)
","text":"The size of the instance relative to its parent.
"},{"location":"objects/system/DynamicInstance/#Position","title":"Position :Vector3
= Vector3.New(0, 10, 0)
","text":"Specifies the position of an instance.
"},{"location":"objects/system/DynamicInstance/#rightvector3","title":"Right:Vector3","text":"The right vector of this DynamicInstance
Example
part.Translate(part.Right * 5)\n
"},{"location":"objects/system/DynamicInstance/#Rotation","title":"Rotation : Vector3
= Vector3.New(0, 45, 0)
","text":"Specifies the rotation of an instance.
Rotation is in euler angles.
"},{"location":"objects/system/DynamicInstance/#Size","title":"Size :Vector3
= Vector3.New(5, 10, 4)
","text":"Specifies the size of an instance.
"},{"location":"objects/system/DynamicInstance/#Up","title":"Up :Vector3
","text":"The Y axis of this DynamicInstance
"},{"location":"objects/system/Instance/","title":"Instance","text":"Instance is the base class of all classes. Every class derives from it and has all properties, events and functions Instance has.
"},{"location":"objects/system/Instance/#properties","title":"Properties","text":""},{"location":"objects/system/Instance/#CanReparent","title":"CanReparent :boolean
","text":"Returns whether this instance can be reparented/deleted or not.
"},{"location":"objects/system/Instance/#ClassName","title":"ClassName :string
","text":"Returns the name of the class.
"},{"location":"objects/system/Instance/#Item","title":"Item : Instance","text":"Specifies the name of an instance.
"},{"location":"objects/system/Instance/#Name","title":"Name :string
","text":"Specifies the name of an instance.
"},{"location":"objects/system/Instance/#Parent","title":"Parent : Instance","text":"Specifies the parent instance of an instance.
"},{"location":"objects/system/Instance/#Shared","title":"Shared :Table
","text":"An empty table you can use to hold metadata about anything on any object or player you want.
Doesn't sync from the client to the server, or from the server to the client.
Example
-- Script 1\nlocal players = game.Players.GetChildren()\nlocal lucky = players[math.random(1, #players)]\n\nlucky.Shared.IsZombie = true\n\n-- Script 2\nlocal killBrick = game.Environment[\"Kill Brick\"]\n\nkillBrick.Touched:Connect(function(hit)\n if hit.IsA(\"Player\") then\n if hit.Shared.IsZombie then\n print(\"YOU CAN'T KILL ME, I'M ALREADY DEAD!\")\n else\n hit.Health = 0\n end\n end\nend\n
"},{"location":"objects/types/","title":"Types","text":""},{"location":"objects/types/Color/","title":"Color","text":"Color is a data type that represents a color.
"},{"location":"objects/types/Color/#notes","title":"Notes","text":"Alpha is between 1 and 255.
"},{"location":"objects/types/Color/#constructors","title":"Constructors","text":"Name Description Color.New() Creates a new black color. Color.New(number
n) Creates a new Color with an R, G and B value of n. Color.New(number
r, number
g, number
b) Creates a new Color with the set R, G and B values and an alpha value of 1 Color.New(number
r, number
g, number
b, number
a) Creates a new Color with the set R, G, B and A values Color.FromHex(string
HEX) Creates a new Color from the specified hex value. Color.Random() Returns a random color with an alpha value of 1. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color."},{"location":"objects/types/Color/#properties","title":"Properties","text":"Name Description number
r Red color component number
g Green color component number
b Blue color component number
a Alpha (opacity) color component"},{"location":"objects/types/Color/#functions","title":"Functions","text":"Name Description Color.Lerp(Color
a, Color
, b, number
t) Linearly interpolates colors a and b by t."},{"location":"objects/types/NetMessage/","title":"NetMessage","text":"NetMessage is a data type used for transporting data between client and server.
"},{"location":"objects/types/NetMessage/#constructors","title":"Constructors","text":"Name Description NetMessage.New() Creates a new NetMessage. NetMessage.AddString(string
key, string
value) Sets a key as a string. NetMessage.GetString(string
key) Gets the value of a string key. NetMessage.AddInt(string
key, int
int) Sets a key as an integer. NetMessage.GetInt(string
key) Gets the value of a integer key. NetMessage.AddNumber(string
key, number
number) Sets a key as a number. NetMessage.GetNumber(string
key) Gets the value of a number key. NetMessage.AddBool(string
key, boolean
bool) Sets a key as a boolean. NetMessage.GetBool(string
key) Gets the value of a boolean key. NetMessage.AddVector2(string
key, Vector2
Vector2) Sets a key as a Vector2. NetMessage.GetVector2(string
key) Gets the value of a Vector2 key. NetMessage.AddVector3(string
key, Vector3
Vector3) Sets a key as a Vector3. NetMessage.GetVector3(string
key) Gets the value of a Vector3 key. NetMessage.AddColor(string
key, Color
Color) Sets a key as a Color. NetMessage.GetColor(string
key) Gets the value of a Color key. NetMessage.AddInstance(string
key, Instance
Instance) Sets a key as an Instance. NetMessage.GetInstance(string
key) CGets the value of an Instance key."},{"location":"objects/types/RayResult/","title":"RayResult","text":"RayResult is a data type that contains data about a raycast result.
"},{"location":"objects/types/RayResult/#constructors","title":"Constructors","text":"Name DescriptionInstance
Instance The instance hit by the raycast. Vector3
Position The position the ray made contact at. number
Distance The distance between the hit and origin. Vector3
Normal The normal of the surface the ray hit."},{"location":"objects/ui/","title":"UI","text":""},{"location":"objects/ui/UIButton/","title":"UIButton","text":""},{"location":"objects/ui/UIField/","title":"UIField","text":""},{"location":"objects/ui/UIField/#properties","title":"Properties","text":""},{"location":"objects/ui/UIField/#PivotPoint","title":"PivotPoint : Vector2
= Vector2.New(0.5, 0.5)
","text":"The pivot point of the UI element.
"},{"location":"objects/ui/UIField/#PositionOffset","title":"PositionOffset :Vector2
= Vector2.New(100, 100)
","text":"The offset of the UI element in pixels.
"},{"location":"objects/ui/UIField/#PositionRelative","title":"PositionRelative :Vector2
= Vector2.New(0.5, 0.5)
","text":"The position of the UI element relative to its parent.
"},{"location":"objects/ui/UIField/#Rotation","title":"Rotation :Single
","text":"The rotation of the UI element.
"},{"location":"objects/ui/UIField/#SizeOffset","title":"SizeOffset :Vector2
= Vector2.New(100, 100)
","text":"The size of the UI element in pixels.
"},{"location":"objects/ui/UIField/#SizeRelative","title":"SizeRelative :Vector2
= Vector2.New(1, 1)
","text":"The size of the UI element relative to its parent.
"},{"location":"objects/ui/UIField/#Visible","title":"Visible :boolean
","text":"Determines whether the UI element is visible or not.
"},{"location":"objects/ui/UIHVLayout/","title":"UIHVLayout","text":"UIHVLayout is the base class for all UI layout elements.
"},{"location":"objects/ui/UIHorizontalLayout/","title":"UIHorizontalLayout","text":"UIHorizontalLayout aligns all children horizontally.
"},{"location":"objects/ui/UIImage/","title":"UIImage","text":""},{"location":"objects/ui/UIImage/#properties","title":"Properties","text":""},{"location":"objects/ui/UIImage/#Color","title":"Color : Color","text":"Specifies the color of the image.
"},{"location":"objects/ui/UIImage/#ImageID","title":"ImageID :Int32
","text":"Specifies the image ID of the UIImage.
"},{"location":"objects/ui/UIImage/#Loading","title":"Loading :boolean
","text":"True if the image is loading.
Example
while image.Loading do\n wait(0)\nend\nprint(\"Image loaded\")\n
"},{"location":"objects/ui/UIImage/#Visible","title":"Visible : boolean
","text":"Specifies if the image is visible.
"},{"location":"objects/ui/UILabel/","title":"UILabel","text":"UILabel is a label that can be used to display text.
"},{"location":"objects/ui/UILabel/#properties","title":"Properties","text":""},{"location":"objects/ui/UILabel/#AutoSize","title":"AutoSize :boolean
","text":"Whether the text should be automatically sized to fit the label's size.
"},{"location":"objects/ui/UILabel/#Font","title":"Font : :polytoria-TextFontPreset: TextFontPreset","text":"The font of the label.
"},{"location":"objects/ui/UILabel/#FontSize","title":"FontSize :number
","text":"The font size of the label.
"},{"location":"objects/ui/UILabel/#JustifyText","title":"JustifyText : :polytoria-TextJustify: TextJustify","text":"Determines how the text is justified.
"},{"location":"objects/ui/UILabel/#MaxFontSize","title":"MaxFontSize :Single
","text":"The maximum font size of the UI element if AutoSize is set to true.
"},{"location":"objects/ui/UILabel/#Text","title":"Text :string
","text":"The text of the label.
"},{"location":"objects/ui/UILabel/#TextColor","title":"TextColor : Color","text":"The color of the text.
"},{"location":"objects/ui/UILabel/#verticalaligntextverticalalign","title":"VerticalAlign:TextVerticalAlign","text":"The vertical alignment of the text.
"},{"location":"objects/ui/UITextInput/","title":"UITextInput","text":"UITextInput is an element that allows the user to enter text.
"},{"location":"objects/ui/UITextInput/#properties","title":"Properties","text":""},{"location":"objects/ui/UITextInput/#AutoSize","title":"AutoSize :boolean
","text":"Whether the text should be automatically sized to fit the label's size.
"},{"location":"objects/ui/UITextInput/#Font","title":"Font : :polytoria-TextFontPreset: TextFontPreset","text":"The font of the label.
"},{"location":"objects/ui/UITextInput/#FontSize","title":"FontSize :Single
","text":"The font size of the label.
"},{"location":"objects/ui/UITextInput/#IsMultiline","title":"IsMultiline :boolean
","text":"Set if the text input can be multiline.
"},{"location":"objects/ui/UITextInput/#IsReadOnly","title":"IsReadOnly :boolean
","text":"Set if the text input can be edited or not.
"},{"location":"objects/ui/UITextInput/#JustifyText","title":"JustifyText : :polytoria-TextJustify: TextJustify","text":"Determines how the text is justified.
"},{"location":"objects/ui/UITextInput/#MaxFontSize","title":"MaxFontSize :Single
","text":"The maximum font size of the UI element if AutoSize is set to true.
"},{"location":"objects/ui/UITextInput/#Placeholder","title":"Placeholder :string
","text":"The placeholder of the text input.
"},{"location":"objects/ui/UITextInput/#PlaceholderColor","title":"PlaceholderColor : Color","text":"The color of the placeholder text.
Example
element.PlaceholderColor = Color.New(0, 0, 0, 0.5)\n
"},{"location":"objects/ui/UITextInput/#Text","title":"Text : string
","text":"The text of the label.
"},{"location":"objects/ui/UITextInput/#TextColor","title":"TextColor : Color","text":"The color of the text.
"},{"location":"objects/ui/UITextInput/#VerticalAlign","title":"VerticalAlign : :polytoria-TextVerticalAlign: TextVerticalAlign","text":"The vertical alignment of the text.
"},{"location":"objects/ui/UIVerticalLayout/","title":"UIVerticalLayout","text":"UIVerticalLayout aligns all children vertically.
"},{"location":"objects/ui/UIView/","title":"UIView","text":"UIView is an element that displays a rectangle.
"},{"location":"objects/ui/UIView/#properties","title":"Properties","text":""},{"location":"objects/ui/UIView/#BorderColor","title":"BorderColor : Color","text":"The border color of the UI.
"},{"location":"objects/ui/UIView/#BorderWidth","title":"BorderWidth :Single
","text":"The border width of the UI.
"},{"location":"objects/ui/UIView/#Color","title":"Color : Color","text":"The color of the UI.
"},{"location":"objects/ui/UIView/#CornerRadius","title":"CornerRadius :Single
","text":"Corner radius of the UI.
"},{"location":"objects/world/","title":"World","text":""},{"location":"objects/world/BasePart/","title":"BasePart","text":""},{"location":"objects/world/GUI3D/","title":"GUI3D","text":""},{"location":"objects/world/MeshPart/","title":"MeshPart","text":""},{"location":"objects/world/Model/","title":"Model","text":"A model is an instance that can hold other instances, and which transform affects its children.
"},{"location":"objects/world/NPC/","title":"NPC","text":"An NPC (Non-Player Character) is an object similar to a Player but that can be controlled by code. Like players, it can walk and jump, and it's body part colors can be customized.
"},{"location":"objects/world/NPC/#properties","title":"Properties","text":""},{"location":"objects/world/NPC/#Anchored","title":"Anchored :boolean
","text":"Determines whether the NPC is affected by physics or not.
"},{"location":"objects/world/NPC/#Grounded","title":"Grounded :boolean
","text":"Returns true if the NPC is currently standing on the ground.
"},{"location":"objects/world/NPC/#HeadColor","title":"HeadColor : Color","text":"Specifies the color of the NPC's head.
"},{"location":"objects/world/NPC/#Health","title":"Health :number
","text":"Specifies the current amount of health the NPC has.
"},{"location":"objects/world/NPC/#LeftArmColor","title":"LeftArmColor : Color","text":"Specifies the color of the NPC's left arm.
"},{"location":"objects/world/NPC/#LeftLegColor","title":"LeftLegColor : Color","text":"Specifies the color of the NPC's left leg.
"},{"location":"objects/world/NPC/#MaxHealth","title":"MaxHealth :number
= 100
","text":"Specifies the maximum amount of health a NPC can have.
"},{"location":"objects/world/NPC/#MoveTarget","title":"MoveTarget : Instance","text":"Determines the instance the NPC should walk towards.
"},{"location":"objects/world/NPC/#RightArmColor","title":"RightArmColor : Color","text":"Specifies the color of the NPC's right arm.
"},{"location":"objects/world/NPC/#RightLegColor","title":"RightLegColor : Color","text":"Specifies the color of the NPC's right leg.
"},{"location":"objects/world/NPC/#TorsoColor","title":"TorsoColor : Color","text":"Specifies the color of the NPC's torso.
"},{"location":"objects/world/NPC/#methods","title":"Methods","text":""},{"location":"objects/world/NPC/#LoadAppearance","title":"LoadAppearance \u2192void
","text":"Loads the specified user ID's avatar on the NPC.
Example
-- Loads the appearance of willemsteller\nnpc:LoadAppearance(2)\n
"},{"location":"objects/world/NPC/#ClearAppearance","title":"ClearAppearance \u2192 void
","text":"Clears the NPC's appearance.
Example
-- Clears the appearance of the NPC\nnpc:ClearAppearance()\n
"},{"location":"objects/world/Part/","title":"Part","text":"Parts are physical objects that can be placed in the world.
"},{"location":"objects/world/Part/#properties","title":"Properties","text":""},{"location":"objects/world/Part/#Anchored","title":"Anchored :boolean
","text":"Specifies whether the part is to be affected by physics or not.
"},{"location":"objects/world/Part/#AngularDrag","title":"AngularDrag :number
","text":"Angular drag (air resistance) of this part.
"},{"location":"objects/world/Part/#AngularDrag","title":"AngularDrag :number
","text":"Angular drag (air resistance) of this part.
"},{"location":"objects/world/Part/#AngularVelocity","title":"AngularVelocity :Vector3
","text":"Specifies the angular velocity of a part.
"},{"location":"objects/world/Part/#CanCollide","title":"CanCollide :boolean
","text":"Specifies whether the part can be collided with or not.
"},{"location":"objects/world/Part/#Color","title":"Color : Color","text":"Specifies the color of a part.
"},{"location":"objects/world/Part/#Drag","title":"Drag :number
","text":"Drag (air resistance) of this part.
"},{"location":"objects/world/Part/#Forward","title":"Forward :Vector3
","text":"Returns the forward vector of the part
"},{"location":"objects/world/Part/#HideStuds","title":"HideStuds :boolean
","text":"Controls whether to display studs on the part or not.
"},{"location":"objects/world/Part/#IsSpawn","title":"IsSpawn :boolean
","text":"Specifies whether the part can be used as a spawn location or not.
"},{"location":"objects/world/Part/#Mass","title":"Mass :number
","text":"Specifies the mass of a part in kilograms.
"},{"location":"objects/world/Part/#Material","title":"Material : :polytoria-PartMaterial: PartMaterial","text":"Specifies the material of the part.
Example
part.Material = PartMaterial.Concrete\n
"},{"location":"objects/world/Part/#Shape","title":"Shape : :polytoria-PartShape: PartShape","text":"Specifies the shape of a part.
Example
part.Shape = PartShape.Wedge\n
"},{"location":"objects/world/Part/#UseGravity","title":"UseGravity : boolean
","text":"Determines whether this part is affected by gravity or not.
"},{"location":"objects/world/Part/#Velocity","title":"Velocity :Vector3
","text":"Specifies the velocity of a part.
"},{"location":"objects/world/Seat/","title":"Seat","text":"Seats are parts the player can sit on.
"},{"location":"objects/world/Seat/#properties","title":"Properties","text":""},{"location":"objects/world/Seat/#Occupant","title":"Occupant : Player","text":"The player that is currently sitting in this seat.
Example
seat.Occupant:Unsit()\n
"},{"location":"objects/world/Text3D/","title":"Text3D","text":"Text3D allows placement of text in the world.
"},{"location":"objects/world/Text3D/#properties","title":"Properties","text":""},{"location":"objects/world/Text3D/#Color","title":"Color : Color","text":"Specifies the color of the text.
Example
text.Color = Color.Random()\n
"},{"location":"objects/world/Text3D/#FaceCamera","title":"FaceCamera : boolean
","text":"Specifies whether the text should always be facing the camera or not.
"},{"location":"objects/world/Text3D/#FontSize","title":"FontSize :number
","text":"Specifies the size of the font.
"},{"location":"objects/world/Text3D/#HorizontalAlignment","title":"HorizontalAlignment :HorizontalAlignment
","text":"Specifies the horizontal alignment of the text.
"},{"location":"objects/world/Text3D/#Text","title":"Text :string
","text":"Specifies the text to display.
"},{"location":"objects/world/Text3D/#VerticalAlignment","title":"VerticalAlignment :VerticalAlignment
","text":"Specifies the vertical alignment of the text.
"},{"location":"objects/world/Tool/","title":"Tool","text":"Tools are objects that can be held by players.
"},{"location":"objects/world/Tool/#events","title":"Events","text":""},{"location":"objects/world/Tool/#Activated","title":"Activated","text":"Gets fired when the user clicks while holding the tool.
Example
tool.Activated:Connect(function()\n print(\"Tool has been activated!\")\nend)\n
"},{"location":"objects/world/Tool/#methods","title":"Methods","text":""},{"location":"objects/world/Tool/#Play","title":"Play \u2192 void
","text":"Plays an animation on the tool or the player that is currently holding the tool.
"},{"location":"objects/world/Tool/#properties","title":"Properties","text":""},{"location":"objects/world/Tool/#Droppable","title":"Droppable :boolean
","text":"Determines whether the tool can be dropped by the player or not.
"},{"location":"objects/world/Truss/","title":"Truss","text":"Trusses are parts that can be climbed by the player.
"},{"location":"tutorials/advanced-scripting/","title":"Advanced Scripting","text":"TODO
"},{"location":"tutorials/basic-scripting/","title":"Basic Scripting","text":"Scripting in Polytoria is done using the Lua programming language. This chapter of tutorials will help you to learn and to familiarize yourself with the programming language as well as Polytoria's Scripting API.
"},{"location":"tutorials/basic-scripting/accessing-objects/","title":"Accessing Objects in a Script","text":"To interact with the world using a script, you must be able to access objects to modify their properties, call their functions or connect code to an event.
You may access objects in the world like how you would access children of a table. Every object is a descendant of game
. To help you understand this, you may look at the Explorer, which has every object listed in the way it needs to be accessed using code.
If you have multiple objects with the same name under the same parent, the script will use the first object it finds with that name. Additionally, you may use :FindChild(instance name here
) as well.
Example:
game[\"Environment\"][\"myPart\"]\ngame[\"Environment\"]:FindChild(\"myPart\")\n
Environment
is a child of game
and myPart
is a child of Environment
. You may use variables to hold references to objects.
local myPart = game[\"Environment\"][\"myPart\"]\n
You may store references to objects in tables.
local parts = {\n game[\"Environment\"][\"myPart\"],\n game[\"Environment\"][\"Index's Epic Tool\"],\n game[\"Environment\"][\"Baggy Man Light\"],\n game[\"Environment\"]:FindChild(\"Diving for Treasure Text3D\")\n}\n
Accessing a child of an object that doesn't exist results in an error:
-- Will error: \"Cannot index nil\"\ngame[\"Environment\"][\"Non-existant Object\"][\"myPart2\"]\n
Accessing a non-existant child of an object will not error instantly, but further use cases might do:
local part = game[\"Environment\"][\"Existing Model\"][\"Non existing Part\"]\n\n-- Will error: \"Cannot index nil\"\nlocal light = part[\"Light source\"]\n\n-- Will error: \"Cannot index nil\"\nlocal price = part:FindChild(\"PriceValue\")\n
Accessing a non-existant child of an object will return nil
, which we can use to check if an object exists:
if game[\"Environment\"][\"myPart\"] ~= nil then\n print(\"myPart exists!\")\nend\n\n-- :FindChild() returns nil if no objects are found\nif game[\"Environment\"]:FindChild(\"my second Part\") == nil then\n print(\"my second Part doesn't exist!\")\nend\n
View Modifying Object Properties to find out how to modify object properties.
"},{"location":"tutorials/basic-scripting/modifying-object-properties/","title":"Modifying Object Properties","text":"Modifying object properties is a vital part of scripting, as it allows you to manipulate objects.
To get and set properties, you need a reference to the object itself. View Accessing Objects in a Script for more info.
To access a property, you may use the dot notation.
Example:
game[\"Environment\"][\"myPart\"].Position\n
Tip: To see a list of properties, that the object may have, you can view its documentation or look at its properties below the Explorer. That alone will already return the value of the property. Although nothing is being done with it. You may use something like print()
to print out the value to the console.
Example:
print(game[\"Environment\"][\"myPart\"].Position)\n
(Image of developer console with that output here) To set the property, you may do it how you would set variables.
Example:
game[\"Environment\"][\"myPart\"].Position = Vector3.New(10,10,10)\n
There are certain properties that can't be changed:
-- Will error, the property 'ClassName' is read-only.\ngame[\"Environment\"][\"myPart\"].ClassName = \"StringValue\"\n
Tip: To see which properties are read-only, you may look them up in the Documentation. Changing the Name
and Parent
properties, which every object has, will affect how you access that object in the script. Changing the Name
property renames the object and changing the Parent
will move the object to a new Parent in the place structure.
Example using Name
:
-- myPart gets renamed to epicPart\ngame[\"Environment\"][\"myPart\"].Name = \"epicPart\"\n\n-- You can no longer access that part using game[\"Environment\"][\"myPart\"], as its name changed.\nprint(game[\"Environment\"][\"epicPart\"].Name) -- Prints out \"epicPart\"\n
Example using Parent
:
-- myPart gets reparented to game[\"Hidden\"]\ngame[\"Environment\"][\"myPart\"].Parent = game[\"Hidden\"]\n\n-- You can no longer access that part using game[\"Environment\"][\"myPart\"], as its parent, and thus its location in the place structure, changed.\nprint(game[\"Hidden\"][\"myPart\"].Parent.Name) -- Prints out \"Hidden\"\n
References to object will not be lost, despite the object being renamed and moved to new parents:
local myPart = game[\"Environment\"][\"myPart\"]\n\nmyPart.Name = \"The Part\"\n\n-- We can still access the same object using the variable, despite it changing names.\nprint(myPart.Name) -- Prints out \"The Part\"\n\n\nmyPart.Parent = game[\"ScriptService\"]\n\n-- We can also still access the same object using the variable, despite it being reparented.\nprint(myPart.Parent.Name) -- Prints out \"ScriptService\"\n
"},{"location":"tutorials/basic-scripting/project-basic-obby/","title":"Project 1: Basic Obby","text":"Now that you've learned enough of Lua and Polytoria's Scripting API you are now ready to create your first project.
"},{"location":"tutorials/getting-started/","title":"Getting Started","text":"To get you started with making your own places, you may use the Documentation and Tutorials here to learn the Creator as well as the Scripting API.
View Setting up Polytoria Creator to set up the Creator and view Understanding Creator's Interface to learn the Creator Interface.
If you are ready to learn further, you may visit Basic Scripting to begin learning scripting on Polytoria.
"},{"location":"tutorials/getting-started/creator-interface/","title":"Understanding Creator's Interface","text":"This page will explain you everything about the Creator Interface.
When you start the creator via the \"Launch Creator\" button on the Create page, you will see the following screen:
"},{"location":"tutorials/getting-started/creator-interface/#setup-wizard","title":"Setup Wizard","text":"Polytoria Creator, available for Windows, Mac and Linux, is a tool to make your own places on Polytoria.
"},{"location":"tutorials/getting-started/creator-setup/#system-requirements","title":"System Requirements","text":"Operating System Windows MacOS Linux Operating System Version Windows 7 (SP1+), Windows 10 and Windows 11 High Sierra 10.13+ Ubuntu 20.04, Ubuntu 18.04, and CentOS 7 CPU x86, x64 architecture with SSE2 instruction set support. Apple Silicon, x64 architecture with SSE2. x64 architecture with SSE2 instruction set support. Graphics API DX10, DX11, DX12 capable. Metal capable Intel and AMD GPUs OpenGL 3.2+, Vulkan capable. RAM At least 1GB+ Internet Connection An internet connection is required to update the creator and connect to its services.A 2-button mouse with a scroll wheel is also recommended.
"},{"location":"tutorials/getting-started/creator-setup/#launching-the-creator","title":"Launching the Creator","text":"Note: If you haven't downloaded the Launcher yet, you must download it from the Places page.
"},{"location":"tutorials/getting-started/creator-setup/#going-further","title":"Going further","text":"You should now be ready to learn the Creator's Interface. View Understanding Creator's Interface to learn more.
"},{"location":"tutorials/guis/","title":"GUIs","text":"TODO
"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":"Welcome to the Polytoria Scripting API documentation! This documentation provides up-to-date information on creating your experiences on Polytoria using scripting.
Polytoria uses the\u00a0Lua programming language. If you are unfamiliar with Lua, you can find the documentation here
"},{"location":"#contributing-to-our-docs","title":"Contributing to our docs","text":"The entire documentation is open source; you can access it right now!
You can contribute to our documenting efforts by creating a pull request on our GitHub repository. Feel free to add working examples or clarifications where needed.
"},{"location":"#credits","title":"Credits","text":"The Polytoria Scripting documentation site is powered by Material for MkDocs. If you are having any issues with the site, consider contributing to the Material for MkDocs project.
"},{"location":"objects/effects/","title":"Effects & Utilities","text":""},{"location":"objects/effects/Accessory/","title":"Accessory","text":""},{"location":"objects/effects/Animator/","title":"Animator","text":""},{"location":"objects/effects/BodyPart/","title":"BodyPart","text":""},{"location":"objects/effects/Decal/","title":"Decal","text":"Decals are objects that can have an image texture and are placed in the world.
"},{"location":"objects/effects/Decal/#properties","title":"Properties","text":""},{"location":"objects/effects/Decal/#ImageID","title":"ImageID :number
","text":"Specifies the image asset ID of the decal.
Example
game[\"Environment\"][\"Decal\"].ImageID = 11643\n
"},{"location":"objects/effects/Light/","title":"Light","text":""},{"location":"objects/effects/PointLight/","title":"PointLight","text":"PointLight is a source of light that can be placed in the world.
"},{"location":"objects/effects/PointLight/#properties","title":"Properties","text":""},{"location":"objects/effects/PointLight/#Brightness","title":"Brightness :number
","text":"Specifies how bright/intense the light is.
"},{"location":"objects/effects/PointLight/#Color","title":"Color : Color","text":"Specifies the color of the light.
"},{"location":"objects/effects/PointLight/#Range","title":"Range :number
","text":"Specifies how far out the light can reach.
"},{"location":"objects/effects/PointLight/#Shadows","title":"Shadows :boolean
","text":"Specifies whether this light emits shadows or not.
Shadows
Having many lights with shadows enabled will cause a massive hit in performance. Consider minimzing the amount of lights with shadows to ensure every player is enjoying your game with minimal framerate issues.
"},{"location":"objects/effects/Sound/","title":"Sound","text":"Sounds are objects that can be placed in the world and that emit audio.
"},{"location":"objects/effects/Sound/#events","title":"Events","text":""},{"location":"objects/effects/Sound/#Loaded","title":"Loaded","text":"The event that is fired when the sound is loaded from the server.
Example
sound.Loaded:Connect(function()\n sound.Play()\nend)\n
"},{"location":"objects/effects/Sound/#methods","title":"Methods","text":""},{"location":"objects/effects/Sound/#Play","title":"Play \u2192 void
","text":"Plays the sound.
"},{"location":"objects/effects/Sound/#Stop","title":"Stop \u2192void
","text":"Stops playing the sound.
"},{"location":"objects/effects/Sound/#properties","title":"Properties","text":""},{"location":"objects/effects/Sound/#Autoplay","title":"Autoplay :boolean
","text":"Determines whether the sound should start playing automatically.
"},{"location":"objects/effects/Sound/#Length","title":"Length :number
","text":"Returns the length of the currently loaded audio
"},{"location":"objects/effects/Sound/#Loop","title":"Loop :boolean
","text":"Determines whether the sound should loop or not.
"},{"location":"objects/effects/Sound/#Pitch","title":"Pitch :number
","text":"The pitch property of this sound
"},{"location":"objects/effects/Sound/#PlayInWorld","title":"PlayInWorld :boolean
","text":"When enabled, the sound will be played in 3D world space rather than having the same volume for everyone.
"},{"location":"objects/effects/Sound/#Playing","title":"Playing :boolean
","text":"Determines whether the sound is currently playing or not.
"},{"location":"objects/effects/Sound/#Size","title":"Size :Vector3
","text":"Property description (what?? change this later)
"},{"location":"objects/effects/Sound/#SoundID","title":"SoundID :number
","text":"The asset ID of the sound.
"},{"location":"objects/effects/Sound/#Time","title":"Time :number
","text":"The time position the track is currently on.
"},{"location":"objects/effects/Sound/#Volume","title":"Volume :number
","text":"The volume of the sound.
"},{"location":"objects/effects/SpotLight/","title":"SpotLight","text":""},{"location":"objects/enums/","title":"Enums","text":""},{"location":"objects/enums/AmbientSource/","title":"AmbientSource","text":"Name Value DescriptionAmbientSource.Skybox
0 Ambient light is taken from the sky AmbientSource.AmbientColor
1 Ambient light is taken from the Lighting.AmbientColor
property"},{"location":"objects/enums/CameraMode/","title":"CameraMode","text":"Name Description CameraMode.Scripted
Camera is able to be controlled by scripts CameraMode.FollowPlayer
Camera is controlled by the player (default)
CameraMode.FreeCam
Camera is able to be freely moved by the player"},{"location":"objects/enums/PartMaterial/","title":"PartMaterial","text":"Name Value PartMaterial.SmoothPlastic
0 PartMaterial.Wood
1 PartMaterial.Concrete
2 PartMaterial.Neon
3 PartMaterial.Metal
4 PartMaterial.Brick
5 PartMaterial.Grass
6 PartMaterial.Dirt
7 PartMaterial.Stone
8 PartMaterial.Snow
9 PartMaterial.Ice
10 PartMaterial.RustyIron
11 PartMaterial.Sand
12 PartMaterial.Sandstone
13 PartMaterial.Plastic
14 PartMaterial.Plywood
15 PartMaterial.Planks
16"},{"location":"objects/enums/PartShape/","title":"PartShape","text":"Name Value PartShape.Ball
0 PartShape.Brick
1 PartShape.Cylinder
2 PartShape.Wedge
3 PartShape.Truss
4 PartShape.TrussFrame
5 PartShape.Bevel
6 PartShape.QuarterPipe
7"},{"location":"objects/enums/SkyboxPreset/","title":"SkyboxPreset","text":"Name Value Description SkyboxPreset.Day1
0 A blue sky with clouds SkyboxPreset.Day2
1 A blue sky with clouds SkyboxPreset.Day3
2 A blue sky with clouds SkyboxPreset.Day4
3 A blue sky with clouds SkyboxPreset.Day5
4 A blue sky with clouds SkyboxPreset.Day6
5 A blue sky with clouds SkyboxPreset.Day7
6 A blue sky with clouds SkyboxPreset.Morning1
7 A morning sky with clouds SkyboxPreset.Morning2
8 A morning sky with clouds SkyboxPreset.Morning3
9 A morning sky with clouds SkyboxPreset.Morning4
10 A morning sky with clouds SkyboxPreset.Night1
11 A night sky with stars SkyboxPreset.Night2
12 A night sky with stars SkyboxPreset.Night3
13 A night sky with stars SkyboxPreset.Night4
14 A night sky with stars SkyboxPreset.Night5
15 A night sky with stars SkyboxPreset.Sunset1
16 A dusk, red sky with clouds SkyboxPreset.Sunset2
17 A dusk, red sky with clouds SkyboxPreset.Sunset3
18 A dusk, red sky with clouds SkyboxPreset.Sunset4
19 A dusk, red sky with clouds SkyboxPreset.Sunset5
20 A dusk, red sky with clouds"},{"location":"objects/enums/TextFontPreset/","title":"TextFontPreset","text":""},{"location":"objects/enums/TextFontPreset/#textfontpreset","title":"TextFontPreset","text":"Name SourceSans
PressStart2P
Montserrat
RobotoMono
Rubik
Poppins
Domine
Fredoka
ComicNeue
Orbitron
"},{"location":"objects/enums/TextJustify/","title":"TextJustify","text":"NameTextJustify.Left
TextJustify.Center
TextJustify.Right
TextJustify.Justify
TextJustify.Flush
"},{"location":"objects/enums/TextVerticalAlign/","title":"TextVerticalAlign","text":"Name TextVerticalAlign.Top
TextVerticalAlign.Middle
TextVerticalAlign.Button
"},{"location":"objects/enums/TweenStyle/","title":"TweenStyle","text":"Name easeInBack easeInBounce easeInCirc easeInCubic easeInElastic easeInExpo easeInOutBack easeInOutBounce easeInOutCirc easeInOutCubic easeInOutElastic easeInOutExpo easeInOutQuad easeInOutQuart easeInOutQuint easeInOutSine easeInQuad easeInQuart easeInQuint easeInSine easeOutBack easeOutBounce easeOutCirc easeOutCubic easeOutElastic easeOutExpo easeOutQuad easeOutQuart easeOutQuint easeOutSine linear punch"},{"location":"objects/game/","title":"Game","text":""},{"location":"objects/game/Backpack/","title":"Backpack","text":"Backpack is a child of player used for storing tools.
"},{"location":"objects/game/Camera/","title":"Camera","text":"This is only available to the client. It can only be accessed within local scripts.
Camera is the local player's camera.
"},{"location":"objects/game/Camera/#properties","title":"Properties","text":""},{"location":"objects/game/Camera/#Distance","title":"Distance :number
","text":"The distance between the camera and the player when the camera is in FollowPlayer mode.
"},{"location":"objects/game/Camera/#FOV","title":"FOV :number
","text":"Sets or return the camera's field of view.
"},{"location":"objects/game/Camera/#FastFlySpeed","title":"FastFlySpeed :number
","text":"The camera speed when the camera is in FreeCam mode while holding shift.
"},{"location":"objects/game/Camera/#FastFlySpeed","title":"FastFlySpeed :number
","text":"The camera speed when the camera is in FreeCam mode.
"},{"location":"objects/game/Camera/#FollowLerp","title":"FollowLerp :boolean
","text":"Determines whether or not to use lerping in FollowPlayer mode.
"},{"location":"objects/game/Camera/#FreeLookSensitivity","title":"FreeLookSensitivity :number
","text":"The mouse sensitivity while in FreeCam mode.
"},{"location":"objects/game/Camera/#HorizontalSpeed","title":"HorizontalSpeed :number
","text":"The horizontal movement speed of the camera in FollowPlayer mode.
"},{"location":"objects/game/Camera/#IsFirstPerson","title":"IsFirstPerson :boolean
","text":"Returns whether or not the camera is in first person.
This property is read-only and cannot be modified.
"},{"location":"objects/game/Camera/#LerpSpeed","title":"LerpSpeed :number
","text":"The lerp speed of the camera when lerping is enabled.
"},{"location":"objects/game/Camera/#MaxDistance","title":"MaxDistance :number
","text":"The camera's maximum distance from the player in FollowPlayer mode.
"},{"location":"objects/game/Camera/#MinDistance","title":"MinDistance :number
","text":"The camera's minimum distance from the player in FollowPlayer mode.
"},{"location":"objects/game/Camera/#Mode","title":"Mode : :polytoria-CameraMode: CameraMode","text":"Sets or returns the camera's current mode.
"},{"location":"objects/game/Camera/#Orthographic","title":"Orthographic :boolean
","text":"Determines whether or not the camera should render in orthographic (2D) mode or not (3D).
"},{"location":"objects/game/Camera/#OrthographicSize","title":"OrthographicSize :number
","text":"Determines the half-size of the camera when in orthographic mode.
"},{"location":"objects/game/Camera/#ScrollSensitivity","title":"ScrollSensitivity :number
","text":"Determines the scroll move speed of the camera.
"},{"location":"objects/game/Camera/#VerticalSpeed","title":"VerticalSpeed :number
","text":"Determines the vertical move speed of the camera.
"},{"location":"objects/game/Environment/","title":"Environment","text":"Environment is the primary object intended for storing active objects in the game.
"},{"location":"objects/game/Environment/#methods","title":"Methods","text":""},{"location":"objects/game/Environment/#CreateExplosion","title":"CreateExplosion \u2192void
","text":"Creates a deadly explosion killing players and applying force to parts at the given position.
Example
game[\"Environment\"]:CreateExplosion(Vector3.New(0, 0, 0), 30, 5000, false)\n
"},{"location":"objects/game/Environment/#Raycast","title":"Raycast \u2192 RayResult
","text":"Casts a ray from origin with a specified direction and returns a RayResult for the first hit object.
Example
local hit = game[\"Environment\"]:Raycast(barrel.Position, barrel.Forward)\n\nif hit and hit.Instance:IsA(\"Player\") then\n hit.Instance.Health = 0\nend\n
"},{"location":"objects/game/Environment/#RaycastAll","title":"RaycastAll \u2192 RayResult[]
","text":"Casts a ray from origin with a specified direction and returns a RayResult array for all hit objects.
Example
local hits = game[\"Environment\"]:RaycastAll(Vector3.New(0, 10, 0), Vector3.New(0, -1, 0), 100)\n\nfor i, hit in pairs(hits) do\n print(\"Hit at \" .. hit.Position .. \"!\")\nend\n
"},{"location":"objects/game/Environment/#properties","title":"Properties","text":""},{"location":"objects/game/Environment/#FogColor","title":"FogColor : Color","text":"The color of the fog. Fog is a visual effect that makes the world look like it is covered in a colored mist.
Example
Change the fog color to white:
game[\"Environment\"].FogColor = Color.New(1, 1, 1, 1)\n
"},{"location":"objects/game/Environment/#FogEnabled","title":"FogEnabled : boolean
","text":"Whether or not fog is enabled.
"},{"location":"objects/game/Environment/#FogStartDistance","title":"FogStartDistance :number
","text":"The distance from the camera at which fog starts to appear
"},{"location":"objects/game/Environment/#FogEndDistance","title":"FogEndDistance :number
","text":"The distance from the camera at which fog is fully opaque
"},{"location":"objects/game/Environment/#Gravity","title":"Gravity :Vector3
= Vector3.New(0, -75, 0)
","text":"The direction and strength of gravity in the world
"},{"location":"objects/game/Environment/#Skybox","title":"Skybox : :polytoria-SkyboxPreset: SkyboxPreset","text":"The default skybox preset to use for the world, if no ImageSky is present.
"},{"location":"objects/game/Game/","title":"Game","text":"Game is the root object in the Polytoria instance tree. It is the object of which everything is descended
"},{"location":"objects/game/Game/#properties","title":"Properties","text":""},{"location":"objects/game/Game/#GameID","title":"GameID :number
","text":"The ID of the current Polytoria place.
The value is 0
when testing locally through Polytoria Creator, which can be used as a conditional to check if the game is live or not.
number
","text":"The total number of instances currently loaded
Remarks
The value will differ depending on if it is being accessed through a Script or a LocalScript, as LocalScripts can only see instances that are relevant to the client.
"},{"location":"objects/game/Game/#events","title":"Events","text":""},{"location":"objects/game/Game/#Rendered","title":"Rendered","text":"Called every frame after the game has been rendered
Notice
The server is incapable of rendering frames; rather, on server Scripts, the event will fire at the server's tick rate which may vary between 1-30Hz.
It is recommended to only listen to this event on LocalScripts.
"},{"location":"objects/game/Hidden/","title":"Hidden","text":"Hidden is a service used for hiding instances.
"},{"location":"objects/game/Lighting/","title":"Lighting","text":"Lighting is responsible for controlling the state of the lighting in the place. It provides many different options for creators to enhance and fine-tune the visuals of their worlds.
By parenting an ImageSky object to Lighting, you can change the skybox of the world.
"},{"location":"objects/game/Lighting/#properties","title":"Properties","text":""},{"location":"objects/game/Lighting/#AmbientColor","title":"AmbientColor : Color","text":"The color of the ambient light. Ambient light is light that is not coming from any particular direction, and is used to simulate light bouncing off of surfaces.
This property is only used if AmbientSource is set to AmbientSource.AmbientColor
.
The source of the ambient light
"},{"location":"objects/game/Lighting/#SunBrightness","title":"SunBrightness :number
","text":"The brightness of the sun
"},{"location":"objects/game/Lighting/#SunColor","title":"SunColor : Color","text":"The color of the sun. This affects the color of the ambient lighting in the environment.
"},{"location":"objects/game/Lighting/#Shadows","title":"Shadows :boolean
","text":"Whether or not shadows are enabled
"},{"location":"objects/game/Player/","title":"Player","text":"Not to be confused with:
Players (the service object that contains all connected players.)
PlayerAvatar (the avatar)
Player is the class of the player and it's character controlled by it's player.
"},{"location":"objects/game/Player/#properties","title":"Properties","text":""},{"location":"objects/game/Player/#CanMove","title":"CanMove :boolean
= true
","text":"Determines whether or not the player can move.
"},{"location":"objects/game/Player/#ChatColor","title":"ChatColor : Color =(255,255,255)
","text":"The player's username color in the chat.
game[\"Players\"][\"willemsteller\"].ChatColor = Color3.New(0, 1, 0)\n
"},{"location":"objects/game/Player/#Health","title":"Health : number
= 100
","text":"The current health of the player.
"},{"location":"objects/game/Player/#IsAdmin","title":"IsAdmin :boolean
","text":"Returns whether or not the player is a Polytoria admin.
This property is read-only and cannot be modified.
"},{"location":"objects/game/Player/#IsCreator","title":"IsCreator :boolean
","text":"Returns whether or not the player is the creator of the current game.
This property is read-only and cannot be modified.
"},{"location":"objects/game/Player/#IsInputFocused","title":"IsInputFocused :boolean
","text":"Determines whether or not the player is currently focused on an input.
"},{"location":"objects/game/Player/#JumpPower","title":"JumpPower :number
= 36
","text":"Specifies how high the player's jump is.
"},{"location":"objects/game/Player/#MaxHealth","title":"MaxHealth :number
= 100
","text":"Specifies the maximum health the player can have.
"},{"location":"objects/game/Player/#MaxStamina","title":"MaxStamina :number
= 3
","text":"Specifies the maximum stamina the player can have.
"},{"location":"objects/game/Player/#RespawnTime","title":"RespawnTime :number
= 5
","text":"Determines how long it takes between the player's death and respawn.
"},{"location":"objects/game/Player/#SittingIn","title":"SittingIn : Seat","text":"Returns the seat the player is currently sitting in, nil
if the player is not sitting in any seat.
number
= 25
","text":"Determines how fast the player is while sprinting.
Remarks
Sprinting can be disabled by setting the player's SprintSpeed to their WalkSpeed.
"},{"location":"objects/game/Player/#Stamina","title":"Stamina :number
= 0
","text":"The player's current amount of stamina.
"},{"location":"objects/game/Player/#StaminaEnabled","title":"StaminaEnabled :boolean
= true
","text":"Determines whether or not stamina is enabled for the player.
"},{"location":"objects/game/Player/#StaminaRegen","title":"StaminaRegen :number
= 1.2
","text":"The rate at which stamina regenerates after being depleted for the player.
"},{"location":"objects/game/Player/#UserID","title":"UserID :number
","text":"Returns the player's user ID.
This property is read-only and cannot be modified.
"},{"location":"objects/game/Player/#WalkSpeed","title":"WalkSpeed :number
= 16
","text":"Determines how fast the player walks.
"},{"location":"objects/game/Player/#events","title":"Events","text":""},{"location":"objects/game/Player/#Chatted","title":"Chatted :string
","text":"Fires when the player sends a chat message.
Example
game[\"Players\"][\"willemsteller\"].Chatted:Connect(function (message)\n print(\"Player wrote: \" .. message)\nend)\n
"},{"location":"objects/game/Player/#Died","title":"Died","text":"Fires when the player dies.
Example
game[\"Players\"][\"willemsteller\"].Died:Connect(function ()\n print(\"Player died\")\nend)\n
"},{"location":"objects/game/Player/#Respawned","title":"Respawned","text":"Fires when the player respawns.
Example
game[\"Players\"][\"willemsteller\"].Respawned:Connect(function ()\n print(\"Player has respawned\")\nend)\n
"},{"location":"objects/game/Player/#methods","title":"Methods","text":""},{"location":"objects/game/Player/#DropTools","title":"DropTools \u2192 void
","text":"Drops the tool the player is currently holding.
This is only available to the server. It can only be accessed within server scripts.
"},{"location":"objects/game/Player/#Kick","title":"Kick \u2192void
","text":"Kicks the player from the server.
This is only available to the server. It can only be accessed within server scripts.
"},{"location":"objects/game/Player/#OwnsItem","title":"OwnsItem \u2192callback
","text":"Checks if the player owns an item
Caching
The function will cache the result for 5 minutes.
Rate Limit
A maximum of 30 requests can be made per minute per server.
Example
player:OwnsItem(11117, function(error, owns)\n if error then\n print(\"An error occurred!\")\n else\n if owns then\n print(\"Player owns Blade of Spooks!\")\n else\n print(\"Player does not own Blade of Spooks!\")\n end\n end\nend)\n
"},{"location":"objects/game/Player/#Respawn","title":"Respawn \u2192 void
","text":"Respawns the player.
"},{"location":"objects/game/Player/#Sit","title":"Sit \u2192Seat
","text":"Sit the player in a specific seat.
"},{"location":"objects/game/Player/#Unsit","title":"Unsit \u2192bool=false
","text":"Unsit the player.
"},{"location":"objects/game/PlayerAvatar/","title":"PlayerAvatar","text":"This currently doesn't exist but has been promised by Polytoria developers.
Not to be confused with:
Players (the service object that contains all connected players.)
Player (the object that represents a single player.)
PlayerAvatar is a class that represents the player's avatar in game.
"},{"location":"objects/game/PlayerDefaults/","title":"PlayerDefaults","text":"PlayerDefaults is a service used for storing the default values of the Player when created.
"},{"location":"objects/game/PlayerDefaults/#properties","title":"Properties","text":""},{"location":"objects/game/PlayerDefaults/#ChatColor","title":"ChatColor : Color =(255,255,255)
","text":"Determines the default color of players' usernames in chat.
"},{"location":"objects/game/PlayerDefaults/#JumpPower","title":"JumpPower :number
= 36
","text":"Determines how high the player jumps by default.
"},{"location":"objects/game/PlayerDefaults/#MaxHealth","title":"MaxHealth :number
= 100
","text":"Determines the default maximum health of players.
"},{"location":"objects/game/PlayerDefaults/#MaxStamina","title":"MaxStamina :number
= 3
","text":"Determines the default maximum stamina of players.
"},{"location":"objects/game/PlayerDefaults/#RespawnTime","title":"RespawnTime :number
= 5
","text":"Determines the default of how long it takes between player's death and respawn.
"},{"location":"objects/game/PlayerDefaults/#SprintSpeed","title":"SprintSpeed :number
= 25
","text":"Determines the default sprint speed of players.
"},{"location":"objects/game/PlayerDefaults/#Stamina","title":"Stamina :number
= 0
","text":"Determines the default stamina of players.
"},{"location":"objects/game/PlayerDefaults/#StaminaEnabled","title":"StaminaEnabled :boolean
= true
","text":"Determines whether or not stamina is enabled by default for players.
"},{"location":"objects/game/PlayerDefaults/#StaminaRegen","title":"StaminaRegen :number
= 1.2
","text":"Determines the default rate at which stamina regenerates after being depleted for players.
"},{"location":"objects/game/PlayerDefaults/#WalkSpeed","title":"WalkSpeed :number
= 16
","text":"Determines how fast the player walks by default.
"},{"location":"objects/game/PlayerDefaults/#methods","title":"Methods","text":""},{"location":"objects/game/PlayerDefaults/#LoadDefaults","title":"LoadDefaults \u2192void
","text":"Resets the specified player back to their default values.
"},{"location":"objects/game/Players/","title":"Players","text":"Not to be confused with Player, the object that represents a single player.
Players is the container class for all Player instances.
"},{"location":"objects/game/Players/#properties","title":"Properties","text":""},{"location":"objects/game/Players/#LocalPlayer","title":"LocalPlayer : Player","text":"Returns the local player currently playing.
This is only available to the client. It can only be accessed within local scripts.
"},{"location":"objects/game/Players/#PlayerCollisionEnabled","title":"PlayerCollisionEnabled :boolean
","text":"Determines whether or not collisions between players are enabled.
"},{"location":"objects/game/Players/#events","title":"Events","text":""},{"location":"objects/game/Players/#PlayerAdded","title":"PlayerAdded :Player
","text":"Fires when a player joins the server.
"},{"location":"objects/game/Players/#PlayerRemoved","title":"PlayerRemoved :Player
","text":"Fires when a player leaves the server.
"},{"location":"objects/game/Players/#methods","title":"Methods","text":""},{"location":"objects/game/Players/#GetPlayer","title":"GetPlayer \u2192Player
","text":"Returns the player instance from their username.
"},{"location":"objects/game/Players/#GetPlayerByID","title":"GetPlayerByID \u2192Player
","text":"Returns the player instance from their user ID.
"},{"location":"objects/game/Players/#GetPlayers","title":"GetPlayers \u2192[]
","text":"Returns all players in the game as an array.
"},{"location":"objects/game/ScriptService/","title":"ScriptService","text":"ScriptService is a service used for storing scripts and local scripts.
"},{"location":"objects/physics/","title":"Physics","text":""},{"location":"objects/physics/BallSocketJoint/","title":"BallSocketJoint","text":""},{"location":"objects/physics/BodyPosition/","title":"BodyPosition","text":"BodyPosition are objects that apply a force to their parent until it moves toward the target position.
"},{"location":"objects/physics/BodyPosition/#properties","title":"Properties","text":""},{"location":"objects/physics/BodyPosition/#AcceptableDistance","title":"AcceptableDistance :number
","text":"Determines how close the body has to be to the target position to stop applying forces to it.
"},{"location":"objects/physics/BodyPosition/#Force","title":"Force :number
","text":"Determines how much force the body applies.
"},{"location":"objects/physics/BodyPosition/#TargetPosition","title":"TargetPosition :Vector3
","text":"Determines the target position that the body applies forces to get to.
"},{"location":"objects/scripting/","title":"Scripting","text":""},{"location":"objects/scripting/BaseScript/","title":"BaseScript","text":"Not to be confused with:
Script (which runs your Lua scripts on the server.)
LocalScript (which runs your Lua scripts on the client.)
void
","text":"Calls a function on another script
Example
game[\"ScriptService\"][\"Script\"]:Call(\"Foo\", \"Bar\")\n
Local Functions
Local Functions cannot be ran using the Call function.
"},{"location":"objects/scripting/BoolValue/","title":"BoolValue","text":"BoolValue is a ValueBase that stores a boolean.
"},{"location":"objects/scripting/BoolValue/#properties","title":"Properties","text":""},{"location":"objects/scripting/BoolValue/#Value","title":"Value :boolean
","text":"The value of this object.
"},{"location":"objects/scripting/ColorValue/","title":"ColorValue","text":"ColorValue is a ValueBase that stores color.
"},{"location":"objects/scripting/ColorValue/#properties","title":"Properties","text":""},{"location":"objects/scripting/ColorValue/#Value","title":"Value : Color","text":"The value of this object.
"},{"location":"objects/scripting/InstanceValue/","title":"InstanceValue","text":"InstanceValue is a ValueBase that stores an instance.
"},{"location":"objects/scripting/InstanceValue/#properties","title":"Properties","text":""},{"location":"objects/scripting/InstanceValue/#Value","title":"Value : Instance","text":"The value of this object.
"},{"location":"objects/scripting/IntValue/","title":"IntValue","text":"IntValue is a ValueBase that stores integers.
"},{"location":"objects/scripting/IntValue/#properties","title":"Properties","text":""},{"location":"objects/scripting/IntValue/#Value","title":"Value :Int32
","text":"The value of this object.
"},{"location":"objects/scripting/LocalScript/","title":"LocalScript","text":"Local Script is a script that runs locally for each player. It can only see what the player can see.
"},{"location":"objects/scripting/NetworkEvent/","title":"NetworkEvent","text":"NetworkEvents are events that can be called to communicate between server and client.
"},{"location":"objects/scripting/NetworkEvent/#events","title":"Events","text":""},{"location":"objects/scripting/NetworkEvent/#InvokedClient","title":"InvokedClient :Sender=nil
, NetMessage
","text":"Fires when the client receives a message from the server.
Example
netEvent.InvokedClient:Connect(function (sender, message)\n local value = message:GetString(\"key\")\nend)\n
This is only available to the client. It can only be accessed within local scripts.
"},{"location":"objects/scripting/NetworkEvent/#InvokedServer","title":"InvokedServer :Sender=Player
, NetMessage
","text":"Fires when the server receives a message from the client.
Example
netEvent.InvokedServer:Connect(function (sender, message)\n local value = message:GetString(\"key\")\nend)\n
This is only available to the server. It can only be accessed within server scripts.
"},{"location":"objects/scripting/NetworkEvent/#methods","title":"Methods","text":""},{"location":"objects/scripting/NetworkEvent/#InvokeClient","title":"InvokeClient \u2192void
","text":"Sends a network event to a specific player from the server.
Example
local message = NetMessage.New()\nmessage.AddString(\"key\", \"value\")\nnetEvent.InvokeClient(message, game[\"Players\"][\"willemsteller\"])\n
This is only available to the server. It can only be accessed within server scripts.
"},{"location":"objects/scripting/NetworkEvent/#InvokeClients","title":"InvokeClients \u2192void
","text":"Sends a network event to all players from the server.
Example
local message = NetMessage.New()\nmessage.AddString(\"key\", \"value\")\nnetEvent.InvokeClients(message)\n
This is only available to the server. It can only be accessed within server scripts.
"},{"location":"objects/scripting/NumberValue/","title":"NumberValue","text":"NumberValue is a ValueBase that stores numbers.
"},{"location":"objects/scripting/NumberValue/#properties","title":"Properties","text":""},{"location":"objects/scripting/NumberValue/#Value","title":"Value :number
","text":"The value of this object.
"},{"location":"objects/scripting/Script/","title":"Script","text":"Script runs Lua scripts on the server.
"},{"location":"objects/scripting/StringValue/","title":"StringValue","text":"StringValue is a ValueBase that stores strings.
"},{"location":"objects/scripting/StringValue/#properties","title":"Properties","text":""},{"location":"objects/scripting/StringValue/#Value","title":"Value :string
","text":"The value of this object.
"},{"location":"objects/scripting/ValueBase/","title":"ValueBase","text":"Not to be confused with:
BoolValue (used for storing bool values.)
ColorValue (used for storing color values.)
InstanceValue (used for storing instances.)
IntValue (used for storing integer values.)
NumberValue (used for storing number values.)
StringValue (used for storing string values.)
Vector2Value (used for storing Vector2 values.)
Vector3Value (used for storing Vector3 values.)
Fires when the value of the ValueBase changes.
"},{"location":"objects/scripting/Vector2Value/","title":"Vector2Value","text":"Vector2Value is a ValueBase that stores Vector2.
"},{"location":"objects/scripting/Vector2Value/#properties","title":"Properties","text":""},{"location":"objects/scripting/Vector2Value/#Value","title":"Value :Vector2
= (5, 10)
","text":"The value of this object.
"},{"location":"objects/scripting/Vector3Value/","title":"Vector3Value","text":"This object can be used for storing Vector3 values.
"},{"location":"objects/scripting/Vector3Value/#properties","title":"Properties","text":""},{"location":"objects/scripting/Vector3Value/#Value","title":"Value :Vector3
= (5, 123, 10)
","text":"The value of this object.
"},{"location":"objects/system/","title":"System","text":""},{"location":"objects/system/DynamicInstance/","title":"DynamicInstance","text":"DynamicInstance is the base class where all objects with a position, rotation and scale derive from.
"},{"location":"objects/system/DynamicInstance/#methods","title":"Methods","text":""},{"location":"objects/system/DynamicInstance/#LookAt","title":"LookAt \u2192void
","text":"Rotates the DynamicInstance so that the forward vector looks at the target.
Example
part.LookAt(Vector3.New(12, 34, 56))\n
"},{"location":"objects/system/DynamicInstance/#Translate","title":"Translate \u2192 void
","text":"Moves the transform in the direction and distance of translation.
Example
part.Translate(part.Forward * 5)\n
"},{"location":"objects/system/DynamicInstance/#properties","title":"Properties","text":""},{"location":"objects/system/DynamicInstance/#Forward","title":"Forward : Vector3
","text":"The forward vector of this DynamicInstance
"},{"location":"objects/system/DynamicInstance/#LocalPosition","title":"LocalPosition :Vector3
= Vector3.New(0, 10, 0)
","text":"Specifies the position relative to the parent of an instance.
"},{"location":"objects/system/DynamicInstance/#LocalRotation","title":"LocalRotation :Vector3
= Vector3.New(0, 45, 0)
","text":"Specifies the rotation relative to the parent of an instance.
Rotation is in euler angles.
"},{"location":"objects/system/DynamicInstance/#LocalSize","title":"LocalSize :Vector3
= Vector3.New(1, 1, 1)
","text":"The size of the instance relative to its parent.
"},{"location":"objects/system/DynamicInstance/#Position","title":"Position :Vector3
= Vector3.New(0, 10, 0)
","text":"Specifies the position of an instance.
"},{"location":"objects/system/DynamicInstance/#Right","title":"Right :Vector3
","text":"The right vector of this DynamicInstance
Example
part.Translate(part.Right * 5)\n
"},{"location":"objects/system/DynamicInstance/#Rotation","title":"Rotation : Vector3
= Vector3.New(0, 45, 0)
","text":"Specifies the rotation of an instance.
Rotation is in euler angles.
"},{"location":"objects/system/DynamicInstance/#Size","title":"Size :Vector3
= Vector3.New(5, 10, 4)
","text":"Specifies the size of an instance.
"},{"location":"objects/system/DynamicInstance/#Up","title":"Up :Vector3
","text":"The Y axis of this DynamicInstance
"},{"location":"objects/system/Instance/","title":"Instance","text":"Instance is the base class of all classes. Every class derives from it and has all properties, events and functions Instance has.
"},{"location":"objects/system/Instance/#properties","title":"Properties","text":""},{"location":"objects/system/Instance/#CanReparent","title":"CanReparent :boolean
","text":"Returns whether this instance can be reparented/deleted or not.
"},{"location":"objects/system/Instance/#ClassName","title":"ClassName :string
","text":"Returns the name of the class.
"},{"location":"objects/system/Instance/#Item","title":"Item : Instance","text":"Specifies the name of an instance.
"},{"location":"objects/system/Instance/#Name","title":"Name :string
","text":"Specifies the name of an instance.
"},{"location":"objects/system/Instance/#Parent","title":"Parent : Instance","text":"Specifies the parent instance of an instance.
"},{"location":"objects/system/Instance/#Shared","title":"Shared :Table
","text":"An empty table you can use to hold metadata about anything on any object or player you want.
Doesn't sync from the client to the server, or from the server to the client.
Example
-- Script 1\nlocal players = game.Players.GetChildren()\nlocal lucky = players[math.random(1, #players)]\n\nlucky.Shared.IsZombie = true\n\n-- Script 2\nlocal killBrick = game.Environment[\"Kill Brick\"]\n\nkillBrick.Touched:Connect(function(hit)\n if hit.IsA(\"Player\") then\n if hit.Shared.IsZombie then\n print(\"YOU CAN'T KILL ME, I'M ALREADY DEAD!\")\n else\n hit.Health = 0\n end\n end\nend\n
"},{"location":"objects/types/","title":"Types","text":""},{"location":"objects/types/Color/","title":"Color","text":"Color is a data type that represents a color.
"},{"location":"objects/types/Color/#notes","title":"Notes","text":"Alpha is between 1 and 255.
"},{"location":"objects/types/Color/#constructors","title":"Constructors","text":"Name Description Color.New() Creates a new black color. Color.New(number
n) Creates a new Color with an R, G and B value of n. Color.New(number
r, number
g, number
b) Creates a new Color with the set R, G and B values and an alpha value of 1 Color.New(number
r, number
g, number
b, number
a) Creates a new Color with the set R, G, B and A values Color.FromHex(string
HEX) Creates a new Color from the specified hex value. Color.Random() Returns a random color with an alpha value of 1. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color. Color.New() Creates a new black color."},{"location":"objects/types/Color/#properties","title":"Properties","text":"Name Description number
r Red color component number
g Green color component number
b Blue color component number
a Alpha (opacity) color component"},{"location":"objects/types/Color/#functions","title":"Functions","text":"Name Description Color.Lerp(Color
a, Color
, b, number
t) Linearly interpolates colors a and b by t."},{"location":"objects/types/NetMessage/","title":"NetMessage","text":"NetMessage is a data type used for transporting data between client and server.
"},{"location":"objects/types/NetMessage/#constructors","title":"Constructors","text":"Name Description NetMessage.New() Creates a new NetMessage. NetMessage.AddString(string
key, string
value) Sets a key as a string. NetMessage.GetString(string
key) Gets the value of a string key. NetMessage.AddInt(string
key, int
int) Sets a key as an integer. NetMessage.GetInt(string
key) Gets the value of a integer key. NetMessage.AddNumber(string
key, number
number) Sets a key as a number. NetMessage.GetNumber(string
key) Gets the value of a number key. NetMessage.AddBool(string
key, boolean
bool) Sets a key as a boolean. NetMessage.GetBool(string
key) Gets the value of a boolean key. NetMessage.AddVector2(string
key, Vector2
Vector2) Sets a key as a Vector2. NetMessage.GetVector2(string
key) Gets the value of a Vector2 key. NetMessage.AddVector3(string
key, Vector3
Vector3) Sets a key as a Vector3. NetMessage.GetVector3(string
key) Gets the value of a Vector3 key. NetMessage.AddColor(string
key, Color
Color) Sets a key as a Color. NetMessage.GetColor(string
key) Gets the value of a Color key. NetMessage.AddInstance(string
key, Instance
Instance) Sets a key as an Instance. NetMessage.GetInstance(string
key) CGets the value of an Instance key."},{"location":"objects/types/RayResult/","title":"RayResult","text":"RayResult is a data type that contains data about a raycast result.
"},{"location":"objects/types/RayResult/#constructors","title":"Constructors","text":"Name DescriptionInstance
Instance The instance hit by the raycast. Vector3
Position The position the ray made contact at. number
Distance The distance between the hit and origin. Vector3
Normal The normal of the surface the ray hit."},{"location":"objects/ui/","title":"UI","text":""},{"location":"objects/ui/UIButton/","title":"UIButton","text":""},{"location":"objects/ui/UIField/","title":"UIField","text":""},{"location":"objects/ui/UIField/#properties","title":"Properties","text":""},{"location":"objects/ui/UIField/#PivotPoint","title":"PivotPoint : Vector2
= Vector2.New(0.5, 0.5)
","text":"The pivot point of the UI element.
"},{"location":"objects/ui/UIField/#PositionOffset","title":"PositionOffset :Vector2
= Vector2.New(100, 100)
","text":"The offset of the UI element in pixels.
"},{"location":"objects/ui/UIField/#PositionRelative","title":"PositionRelative :Vector2
= Vector2.New(0.5, 0.5)
","text":"The position of the UI element relative to its parent.
"},{"location":"objects/ui/UIField/#Rotation","title":"Rotation :Single
","text":"The rotation of the UI element.
"},{"location":"objects/ui/UIField/#SizeOffset","title":"SizeOffset :Vector2
= Vector2.New(100, 100)
","text":"The size of the UI element in pixels.
"},{"location":"objects/ui/UIField/#SizeRelative","title":"SizeRelative :Vector2
= Vector2.New(1, 1)
","text":"The size of the UI element relative to its parent.
"},{"location":"objects/ui/UIField/#Visible","title":"Visible :boolean
","text":"Determines whether the UI element is visible or not.
"},{"location":"objects/ui/UIHVLayout/","title":"UIHVLayout","text":"UIHVLayout is the base class for all UI layout elements.
"},{"location":"objects/ui/UIHorizontalLayout/","title":"UIHorizontalLayout","text":"UIHorizontalLayout aligns all children horizontally.
"},{"location":"objects/ui/UIImage/","title":"UIImage","text":""},{"location":"objects/ui/UIImage/#properties","title":"Properties","text":""},{"location":"objects/ui/UIImage/#Color","title":"Color : Color","text":"Specifies the color of the image.
"},{"location":"objects/ui/UIImage/#ImageID","title":"ImageID :Int32
","text":"Specifies the image ID of the UIImage.
"},{"location":"objects/ui/UIImage/#Loading","title":"Loading :boolean
","text":"True if the image is loading.
Example
while image.Loading do\n wait(0)\nend\nprint(\"Image loaded\")\n
"},{"location":"objects/ui/UIImage/#Visible","title":"Visible : boolean
","text":"Specifies if the image is visible.
"},{"location":"objects/ui/UILabel/","title":"UILabel","text":"UILabel is a label that can be used to display text.
"},{"location":"objects/ui/UILabel/#properties","title":"Properties","text":""},{"location":"objects/ui/UILabel/#AutoSize","title":"AutoSize :boolean
","text":"Whether the text should be automatically sized to fit the label's size.
"},{"location":"objects/ui/UILabel/#Font","title":"Font : :polytoria-TextFontPreset: TextFontPreset","text":"The font of the label.
"},{"location":"objects/ui/UILabel/#FontSize","title":"FontSize :number
","text":"The font size of the label.
"},{"location":"objects/ui/UILabel/#JustifyText","title":"JustifyText : :polytoria-TextJustify: TextJustify","text":"Determines how the text is justified.
"},{"location":"objects/ui/UILabel/#MaxFontSize","title":"MaxFontSize :Single
","text":"The maximum font size of the UI element if AutoSize is set to true.
"},{"location":"objects/ui/UILabel/#Text","title":"Text :string
","text":"The text of the label.
"},{"location":"objects/ui/UILabel/#TextColor","title":"TextColor : Color","text":"The color of the text.
"},{"location":"objects/ui/UILabel/#verticalaligntextverticalalign","title":"VerticalAlign:TextVerticalAlign","text":"The vertical alignment of the text.
"},{"location":"objects/ui/UITextInput/","title":"UITextInput","text":"UITextInput is an element that allows the user to enter text.
"},{"location":"objects/ui/UITextInput/#properties","title":"Properties","text":""},{"location":"objects/ui/UITextInput/#AutoSize","title":"AutoSize :boolean
","text":"Whether the text should be automatically sized to fit the label's size.
"},{"location":"objects/ui/UITextInput/#Font","title":"Font : :polytoria-TextFontPreset: TextFontPreset","text":"The font of the label.
"},{"location":"objects/ui/UITextInput/#FontSize","title":"FontSize :Single
","text":"The font size of the label.
"},{"location":"objects/ui/UITextInput/#IsMultiline","title":"IsMultiline :boolean
","text":"Set if the text input can be multiline.
"},{"location":"objects/ui/UITextInput/#IsReadOnly","title":"IsReadOnly :boolean
","text":"Set if the text input can be edited or not.
"},{"location":"objects/ui/UITextInput/#JustifyText","title":"JustifyText : :polytoria-TextJustify: TextJustify","text":"Determines how the text is justified.
"},{"location":"objects/ui/UITextInput/#MaxFontSize","title":"MaxFontSize :Single
","text":"The maximum font size of the UI element if AutoSize is set to true.
"},{"location":"objects/ui/UITextInput/#Placeholder","title":"Placeholder :string
","text":"The placeholder of the text input.
"},{"location":"objects/ui/UITextInput/#PlaceholderColor","title":"PlaceholderColor : Color","text":"The color of the placeholder text.
Example
element.PlaceholderColor = Color.New(0, 0, 0, 0.5)\n
"},{"location":"objects/ui/UITextInput/#Text","title":"Text : string
","text":"The text of the label.
"},{"location":"objects/ui/UITextInput/#TextColor","title":"TextColor : Color","text":"The color of the text.
"},{"location":"objects/ui/UITextInput/#VerticalAlign","title":"VerticalAlign : :polytoria-TextVerticalAlign: TextVerticalAlign","text":"The vertical alignment of the text.
"},{"location":"objects/ui/UIVerticalLayout/","title":"UIVerticalLayout","text":"UIVerticalLayout aligns all children vertically.
"},{"location":"objects/ui/UIView/","title":"UIView","text":"UIView is an element that displays a rectangle.
"},{"location":"objects/ui/UIView/#properties","title":"Properties","text":""},{"location":"objects/ui/UIView/#BorderColor","title":"BorderColor : Color","text":"The border color of the UI.
"},{"location":"objects/ui/UIView/#BorderWidth","title":"BorderWidth :Single
","text":"The border width of the UI.
"},{"location":"objects/ui/UIView/#Color","title":"Color : Color","text":"The color of the UI.
"},{"location":"objects/ui/UIView/#CornerRadius","title":"CornerRadius :Single
","text":"Corner radius of the UI.
"},{"location":"objects/world/","title":"World","text":""},{"location":"objects/world/BasePart/","title":"BasePart","text":""},{"location":"objects/world/GUI3D/","title":"GUI3D","text":""},{"location":"objects/world/MeshPart/","title":"MeshPart","text":"The part that can have custom mesh applied to it, mesh can be loaded from Polytoria store(Hats, Tools and Head).
"},{"location":"objects/world/MeshPart/#methods","title":"Methods","text":""},{"location":"objects/world/MeshPart/#MovePosition","title":"MovePosition \u2192void
","text":""},{"location":"objects/world/MeshPart/#MoveRotation","title":"MoveRotation \u2192 void
","text":""},{"location":"objects/world/MeshPart/#properties","title":"Properties","text":""},{"location":"objects/world/MeshPart/#Anchored","title":"Anchored : boolean
","text":"Specifies whether the part is to be affected by physics or not.
"},{"location":"objects/world/MeshPart/#AngularVelocity","title":"AngularVelocity :Vector3
= Vector3.New(0, 0, 0)
","text":"Specifies the angular velocity of a part.
"},{"location":"objects/world/MeshPart/#AssetID","title":"AssetID :Int32
","text":"The asset ID of the mesh part.
"},{"location":"objects/world/MeshPart/#CanCollide","title":"CanCollide :boolean
","text":"Specifies whether the part can be collided with or not.
"},{"location":"objects/world/MeshPart/#Loading","title":"Loading :boolean
","text":"True if the mesh is loading.
"},{"location":"objects/world/MeshPart/#Mass","title":"Mass :number
","text":"Specifies the mass of a part in kilograms.
"},{"location":"objects/world/MeshPart/#Material","title":"Material : :polytoria-PartMaterial: PartMaterial","text":"Specifies the material of the part.
"},{"location":"objects/world/MeshPart/#Shape","title":"Shape : :polytoria-PartShape: PartShape","text":"Specifies the shape of a part.
"},{"location":"objects/world/MeshPart/#Velocity","title":"Velocity :Vector3
= Vector3.New(0, 100, 0)
","text":"Specifies the velocity of a part.
"},{"location":"objects/world/Model/","title":"Model","text":"A model is an instance that can hold other instances, and which transform affects its children.
"},{"location":"objects/world/NPC/","title":"NPC","text":"An NPC (Non-Player Character) is an object similar to a Player but that can be controlled by code. Like players, it can walk and jump, and it's body part colors can be customized.
"},{"location":"objects/world/NPC/#events","title":"Events","text":""},{"location":"objects/world/NPC/#Died","title":"Died","text":"Gets triggered when the NPC dies.
Example
game[\"Environment\"][\"NPC\"].Died:Connect(function ()\n print(\"NPC died!\")\nend)\n
"},{"location":"objects/world/NPC/#methods","title":"Methods","text":""},{"location":"objects/world/NPC/#LoadAppearance","title":"LoadAppearance \u2192 void
","text":"Loads the specified user ID's avatar on the NPC.
Example
-- Loads the appearance of willemsteller\nnpc:LoadAppearance(2)\n
"},{"location":"objects/world/NPC/#ClearAppearance","title":"ClearAppearance \u2192 void
","text":"Clears the NPC's appearance.
Example
-- Clears the appearance of the NPC\nnpc:ClearAppearance()\n
"},{"location":"objects/world/NPC/#properties","title":"Properties","text":""},{"location":"objects/world/NPC/#Anchored","title":"Anchored : boolean
","text":"Determines whether the NPC is affected by physics or not.
"},{"location":"objects/world/NPC/#Grounded","title":"Grounded :boolean
","text":"Returns true if the NPC is currently standing on the ground.
"},{"location":"objects/world/NPC/#HeadColor","title":"HeadColor : Color","text":"Specifies the color of the NPC's head.
"},{"location":"objects/world/NPC/#Health","title":"Health :number
","text":"Specifies the current amount of health the NPC has.
"},{"location":"objects/world/NPC/#LeftArmColor","title":"LeftArmColor : Color","text":"Specifies the color of the NPC's left arm.
"},{"location":"objects/world/NPC/#LeftLegColor","title":"LeftLegColor : Color","text":"Specifies the color of the NPC's left leg.
"},{"location":"objects/world/NPC/#MaxHealth","title":"MaxHealth :number
= 100
","text":"Specifies the maximum amount of health a NPC can have.
"},{"location":"objects/world/NPC/#MoveTarget","title":"MoveTarget : Instance","text":"Determines the instance the NPC should walk towards.
"},{"location":"objects/world/NPC/#RightArmColor","title":"RightArmColor : Color","text":"Specifies the color of the NPC's right arm.
"},{"location":"objects/world/NPC/#RightLegColor","title":"RightLegColor : Color","text":"Specifies the color of the NPC's right leg.
"},{"location":"objects/world/NPC/#TorsoColor","title":"TorsoColor : Color","text":"Specifies the color of the NPC's torso.
"},{"location":"objects/world/Part/","title":"Part","text":"Parts are physical objects that can be placed in the world.
"},{"location":"objects/world/Part/#properties","title":"Properties","text":""},{"location":"objects/world/Part/#Anchored","title":"Anchored :boolean
","text":"Specifies whether the part is to be affected by physics or not.
"},{"location":"objects/world/Part/#AngularDrag","title":"AngularDrag :number
","text":"Angular drag (air resistance) of this part.
"},{"location":"objects/world/Part/#AngularDrag","title":"AngularDrag :number
","text":"Angular drag (air resistance) of this part.
"},{"location":"objects/world/Part/#AngularVelocity","title":"AngularVelocity :Vector3
","text":"Specifies the angular velocity of a part.
"},{"location":"objects/world/Part/#CanCollide","title":"CanCollide :boolean
","text":"Specifies whether the part can be collided with or not.
"},{"location":"objects/world/Part/#Color","title":"Color : Color","text":"Specifies the color of a part.
"},{"location":"objects/world/Part/#Drag","title":"Drag :number
","text":"Drag (air resistance) of this part.
"},{"location":"objects/world/Part/#Forward","title":"Forward :Vector3
","text":"Returns the forward vector of the part
"},{"location":"objects/world/Part/#HideStuds","title":"HideStuds :boolean
","text":"Controls whether to display studs on the part or not.
"},{"location":"objects/world/Part/#IsSpawn","title":"IsSpawn :boolean
","text":"Specifies whether the part can be used as a spawn location or not.
"},{"location":"objects/world/Part/#Mass","title":"Mass :number
","text":"Specifies the mass of a part in kilograms.
"},{"location":"objects/world/Part/#Material","title":"Material : :polytoria-PartMaterial: PartMaterial","text":"Specifies the material of the part.
Example
part.Material = PartMaterial.Concrete\n
"},{"location":"objects/world/Part/#Shape","title":"Shape : :polytoria-PartShape: PartShape","text":"Specifies the shape of a part.
Example
part.Shape = PartShape.Wedge\n
"},{"location":"objects/world/Part/#UseGravity","title":"UseGravity : boolean
","text":"Determines whether this part is affected by gravity or not.
"},{"location":"objects/world/Part/#Velocity","title":"Velocity :Vector3
","text":"Specifies the velocity of a part.
"},{"location":"objects/world/Seat/","title":"Seat","text":"Seats are parts the player can sit on.
"},{"location":"objects/world/Seat/#properties","title":"Properties","text":""},{"location":"objects/world/Seat/#Occupant","title":"Occupant : Player","text":"The player that is currently sitting in this seat.
Example
seat.Occupant:Unsit()\n
"},{"location":"objects/world/Text3D/","title":"Text3D","text":"Text3D allows placement of text in the world.
"},{"location":"objects/world/Text3D/#properties","title":"Properties","text":""},{"location":"objects/world/Text3D/#Color","title":"Color : Color","text":"Specifies the color of the text.
Example
text.Color = Color.Random()\n
"},{"location":"objects/world/Text3D/#FaceCamera","title":"FaceCamera : boolean
","text":"Specifies whether the text should always be facing the camera or not.
"},{"location":"objects/world/Text3D/#FontSize","title":"FontSize :number
","text":"Specifies the size of the font.
"},{"location":"objects/world/Text3D/#HorizontalAlignment","title":"HorizontalAlignment :HorizontalAlignment
","text":"Specifies the horizontal alignment of the text.
"},{"location":"objects/world/Text3D/#Text","title":"Text :string
","text":"Specifies the text to display.
"},{"location":"objects/world/Text3D/#VerticalAlignment","title":"VerticalAlignment :VerticalAlignment
","text":"Specifies the vertical alignment of the text.
"},{"location":"objects/world/Tool/","title":"Tool","text":"Tools are objects that can be held by players.
"},{"location":"objects/world/Tool/#events","title":"Events","text":""},{"location":"objects/world/Tool/#Activated","title":"Activated","text":"Gets fired when the user clicks while holding the tool.
Example
tool.Activated:Connect(function()\n print(\"Tool has been activated!\")\nend)\n
"},{"location":"objects/world/Tool/#methods","title":"Methods","text":""},{"location":"objects/world/Tool/#Play","title":"Play \u2192 void
","text":"Plays an animation on the tool or the player that is currently holding the tool.
"},{"location":"objects/world/Tool/#properties","title":"Properties","text":""},{"location":"objects/world/Tool/#Droppable","title":"Droppable :boolean
","text":"Determines whether the tool can be dropped by the player or not.
"},{"location":"objects/world/Truss/","title":"Truss","text":"Trusses are parts that can be climbed by the player.
"},{"location":"tutorials/advanced-scripting/","title":"Advanced Scripting","text":"TODO
"},{"location":"tutorials/basic-scripting/","title":"Basic Scripting","text":"Scripting in Polytoria is done using the Lua programming language. This chapter of tutorials will help you to learn and to familiarize yourself with the programming language as well as Polytoria's Scripting API.
"},{"location":"tutorials/basic-scripting/accessing-objects/","title":"Accessing Objects in a Script","text":"To interact with the world using a script, you must be able to access objects to modify their properties, call their functions or connect code to an event.
You may access objects in the world like how you would access children of a table. Every object is a descendant of game
. To help you understand this, you may look at the Explorer, which has every object listed in the way it needs to be accessed using code.
If you have multiple objects with the same name under the same parent, the script will use the first object it finds with that name. Additionally, you may use :FindChild(instance name here
) as well.
Example:
game[\"Environment\"][\"myPart\"]\ngame[\"Environment\"]:FindChild(\"myPart\")\n
Environment
is a child of game
and myPart
is a child of Environment
. You may use variables to hold references to objects.
local myPart = game[\"Environment\"][\"myPart\"]\n
You may store references to objects in tables.
local parts = {\n game[\"Environment\"][\"myPart\"],\n game[\"Environment\"][\"Index's Epic Tool\"],\n game[\"Environment\"][\"Baggy Man Light\"],\n game[\"Environment\"]:FindChild(\"Diving for Treasure Text3D\")\n}\n
Accessing a child of an object that doesn't exist results in an error:
-- Will error: \"Cannot index nil\"\ngame[\"Environment\"][\"Non-existant Object\"][\"myPart2\"]\n
Accessing a non-existant child of an object will not error instantly, but further use cases might do:
local part = game[\"Environment\"][\"Existing Model\"][\"Non existing Part\"]\n\n-- Will error: \"Cannot index nil\"\nlocal light = part[\"Light source\"]\n\n-- Will error: \"Cannot index nil\"\nlocal price = part:FindChild(\"PriceValue\")\n
Accessing a non-existant child of an object will return nil
, which we can use to check if an object exists:
if game[\"Environment\"][\"myPart\"] ~= nil then\n print(\"myPart exists!\")\nend\n\n-- :FindChild() returns nil if no objects are found\nif game[\"Environment\"]:FindChild(\"my second Part\") == nil then\n print(\"my second Part doesn't exist!\")\nend\n
View Modifying Object Properties to find out how to modify object properties.
"},{"location":"tutorials/basic-scripting/modifying-object-properties/","title":"Modifying Object Properties","text":"Modifying object properties is a vital part of scripting, as it allows you to manipulate objects.
To get and set properties, you need a reference to the object itself. View Accessing Objects in a Script for more info.
To access a property, you may use the dot notation.
Example:
game[\"Environment\"][\"myPart\"].Position\n
Tip: To see a list of properties, that the object may have, you can view its documentation or look at its properties below the Explorer. That alone will already return the value of the property. Although nothing is being done with it. You may use something like print()
to print out the value to the console.
Example:
print(game[\"Environment\"][\"myPart\"].Position)\n
(Image of developer console with that output here) To set the property, you may do it how you would set variables.
Example:
game[\"Environment\"][\"myPart\"].Position = Vector3.New(10,10,10)\n
There are certain properties that can't be changed:
-- Will error, the property 'ClassName' is read-only.\ngame[\"Environment\"][\"myPart\"].ClassName = \"StringValue\"\n
Tip: To see which properties are read-only, you may look them up in the Documentation. Changing the Name
and Parent
properties, which every object has, will affect how you access that object in the script. Changing the Name
property renames the object and changing the Parent
will move the object to a new Parent in the place structure.
Example using Name
:
-- myPart gets renamed to epicPart\ngame[\"Environment\"][\"myPart\"].Name = \"epicPart\"\n\n-- You can no longer access that part using game[\"Environment\"][\"myPart\"], as its name changed.\nprint(game[\"Environment\"][\"epicPart\"].Name) -- Prints out \"epicPart\"\n
Example using Parent
:
-- myPart gets reparented to game[\"Hidden\"]\ngame[\"Environment\"][\"myPart\"].Parent = game[\"Hidden\"]\n\n-- You can no longer access that part using game[\"Environment\"][\"myPart\"], as its parent, and thus its location in the place structure, changed.\nprint(game[\"Hidden\"][\"myPart\"].Parent.Name) -- Prints out \"Hidden\"\n
References to object will not be lost, despite the object being renamed and moved to new parents:
local myPart = game[\"Environment\"][\"myPart\"]\n\nmyPart.Name = \"The Part\"\n\n-- We can still access the same object using the variable, despite it changing names.\nprint(myPart.Name) -- Prints out \"The Part\"\n\n\nmyPart.Parent = game[\"ScriptService\"]\n\n-- We can also still access the same object using the variable, despite it being reparented.\nprint(myPart.Parent.Name) -- Prints out \"ScriptService\"\n
"},{"location":"tutorials/basic-scripting/project-basic-obby/","title":"Project 1: Basic Obby","text":"Now that you've learned enough of Lua and Polytoria's Scripting API you are now ready to create your first project.
"},{"location":"tutorials/getting-started/","title":"Getting Started","text":"To get you started with making your own places, you may use the Documentation and Tutorials here to learn the Creator as well as the Scripting API.
View Setting up Polytoria Creator to set up the Creator and view Understanding Creator's Interface to learn the Creator Interface.
If you are ready to learn further, you may visit Basic Scripting to begin learning scripting on Polytoria.
"},{"location":"tutorials/getting-started/creator-interface/","title":"Understanding Creator's Interface","text":"This page will explain you everything about the Creator Interface.
When you start the creator via the \"Launch Creator\" button on the Create page, you will see the following screen:
"},{"location":"tutorials/getting-started/creator-interface/#setup-wizard","title":"Setup Wizard","text":"Polytoria Creator, available for Windows, Mac and Linux, is a tool to make your own places on Polytoria.
"},{"location":"tutorials/getting-started/creator-setup/#system-requirements","title":"System Requirements","text":"Operating System Windows MacOS Linux Operating System Version Windows 7 (SP1+), Windows 10 and Windows 11 High Sierra 10.13+ Ubuntu 20.04, Ubuntu 18.04, and CentOS 7 CPU x86, x64 architecture with SSE2 instruction set support. Apple Silicon, x64 architecture with SSE2. x64 architecture with SSE2 instruction set support. Graphics API DX10, DX11, DX12 capable. Metal capable Intel and AMD GPUs OpenGL 3.2+, Vulkan capable. RAM At least 1GB+ Internet Connection An internet connection is required to update the creator and connect to its services.A 2-button mouse with a scroll wheel is also recommended.
"},{"location":"tutorials/getting-started/creator-setup/#launching-the-creator","title":"Launching the Creator","text":"Note: If you haven't downloaded the Launcher yet, you must download it from the Places page.
"},{"location":"tutorials/getting-started/creator-setup/#going-further","title":"Going further","text":"You should now be ready to learn the Creator's Interface. View Understanding Creator's Interface to learn more.
"},{"location":"tutorials/guis/","title":"GUIs","text":"TODO
"}]} \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index 37133bfb3d9ae38ce20ff8d6b859782991781622..487f8026b20dc27a466fa1113c570edcf11d4955 100755 GIT binary patch delta 12 Tcmb=gXOr*d;F#e#k*yK{7u*A| delta 12 Tcmb=gXOr*d;P4lm$W{pe6^{ci