{ "pageProps": { "data": { "apiReference": { "name": "Player", "type": "CLASS", "category": "Gameplay", "memoryCategory": "Instances", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "An object that represents a presently connected client to the game.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 3, "offset": 2 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Player", "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 11, "offset": 10 } } } ], "position": { "start": { "line": 1, "column": 3, "offset": 2 }, "end": { "line": 1, "column": 13, "offset": 12 } } }, { "type": "text", "value": " object is a client that is currently connected. These objects are\nadded to the ", "position": { "start": { "line": 1, "column": 13, "offset": 12 }, "end": { "line": 2, "column": 14, "offset": 92 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players" } ], "position": { "start": { "line": 2, "column": 14, "offset": 92 }, "end": { "line": 2, "column": 29, "offset": 107 } } }, { "type": "text", "value": " service when a new player connects, then removed\nwhen they eventually disconnect from the server.", "position": { "start": { "line": 2, "column": 29, "offset": 107 }, "end": { "line": 3, "column": 49, "offset": 205 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 49, "offset": 205 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 5, "column": 1, "offset": 207 }, "end": { "line": 5, "column": 5, "offset": 211 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name" } ], "position": { "start": { "line": 5, "column": 5, "offset": 211 }, "end": { "line": 5, "column": 26, "offset": 232 } } }, { "type": "text", "value": " property reflects the player's username. When saving\ninformation about a player, you should use their ", "position": { "start": { "line": 5, "column": 26, "offset": 232 }, "end": { "line": 6, "column": 50, "offset": 335 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.UserId" } ], "position": { "start": { "line": 6, "column": 50, "offset": 335 }, "end": { "line": 6, "column": 71, "offset": 356 } } }, { "type": "text", "value": " since\nit is possible that a player can change their username.", "position": { "start": { "line": 6, "column": 71, "offset": 356 }, "end": { "line": 7, "column": 56, "offset": 418 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 207 }, "end": { "line": 7, "column": 56, "offset": 418 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "There are several similar methods in the ", "position": { "start": { "line": 9, "column": 1, "offset": 420 }, "end": { "line": 9, "column": 42, "offset": 461 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players" } ], "position": { "start": { "line": 9, "column": 42, "offset": 461 }, "end": { "line": 9, "column": 57, "offset": 476 } } }, { "type": "text", "value": " service for working\nwith Player objects. Use these over their respective ", "position": { "start": { "line": 9, "column": 57, "offset": 476 }, "end": { "line": 10, "column": 54, "offset": 550 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 10, "column": 54, "offset": 550 }, "end": { "line": 10, "column": 70, "offset": 566 } } }, { "type": "text", "value": " methods:", "position": { "start": { "line": 10, "column": 70, "offset": 566 }, "end": { "line": 10, "column": 79, "offset": 575 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 420 }, "end": { "line": 10, "column": 79, "offset": 575 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "You can get a table of current Player objects using\n", "position": { "start": { "line": 12, "column": 3, "offset": 579 }, "end": { "line": 13, "column": 1, "offset": 631 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players:GetPlayers()" } ], "position": { "start": { "line": 13, "column": 3, "offset": 633 }, "end": { "line": 13, "column": 31, "offset": 661 } } }, { "type": "text", "value": "; again, use this instead of\n", "position": { "start": { "line": 13, "column": 31, "offset": 661 }, "end": { "line": 14, "column": 1, "offset": 690 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetChildren()" } ], "position": { "start": { "line": 14, "column": 3, "offset": 692 }, "end": { "line": 14, "column": 33, "offset": 722 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 14, "column": 33, "offset": 722 }, "end": { "line": 14, "column": 34, "offset": 723 } } } ], "position": { "start": { "line": 12, "column": 1, "offset": 577 }, "end": { "line": 14, "column": 34, "offset": 723 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "To detect the addition of Player objects, it is recommended to use the\n", "position": { "start": { "line": 15, "column": 3, "offset": 726 }, "end": { "line": 16, "column": 1, "offset": 797 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players.PlayerAdded" } ], "position": { "start": { "line": 16, "column": 3, "offset": 799 }, "end": { "line": 16, "column": 30, "offset": 826 } } }, { "type": "text", "value": " event (instead of ", "position": { "start": { "line": 16, "column": 30, "offset": 826 }, "end": { "line": 16, "column": 49, "offset": 845 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ChildAdded" } ], "position": { "start": { "line": 16, "column": 49, "offset": 845 }, "end": { "line": 16, "column": 76, "offset": 872 } } }, { "type": "text", "value": " on\nthe ", "position": { "start": { "line": 16, "column": 76, "offset": 872 }, "end": { "line": 17, "column": 7, "offset": 882 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players" } ], "position": { "start": { "line": 17, "column": 7, "offset": 882 }, "end": { "line": 17, "column": 22, "offset": 897 } } }, { "type": "text", "value": " service).", "position": { "start": { "line": 17, "column": 22, "offset": 897 }, "end": { "line": 17, "column": 32, "offset": 907 } } } ], "position": { "start": { "line": 15, "column": 1, "offset": 724 }, "end": { "line": 17, "column": 32, "offset": 907 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Similarly, you can detect the removal of Player objects using\n", "position": { "start": { "line": 18, "column": 3, "offset": 910 }, "end": { "line": 19, "column": 1, "offset": 972 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players.PlayerRemoving" } ], "position": { "start": { "line": 19, "column": 3, "offset": 974 }, "end": { "line": 19, "column": 33, "offset": 1004 } } }, { "type": "text", "value": ", which fires just ", "position": { "start": { "line": 19, "column": 33, "offset": 1004 }, "end": { "line": 19, "column": 52, "offset": 1023 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "before", "position": { "start": { "line": 19, "column": 54, "offset": 1025 }, "end": { "line": 19, "column": 60, "offset": 1031 } } } ], "position": { "start": { "line": 19, "column": 52, "offset": 1023 }, "end": { "line": 19, "column": 62, "offset": 1033 } } }, { "type": "text", "value": " the Player is\nremoved (instead of ", "position": { "start": { "line": 19, "column": 62, "offset": 1033 }, "end": { "line": 20, "column": 23, "offset": 1070 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ChildRemoved" } ], "position": { "start": { "line": 20, "column": 23, "offset": 1070 }, "end": { "line": 20, "column": 52, "offset": 1099 } } }, { "type": "text", "value": " which fires after). This\nis important if you are saving information about the player that might be\nremoved or cleaned up on-removal.", "position": { "start": { "line": 20, "column": 52, "offset": 1099 }, "end": { "line": 22, "column": 36, "offset": 1236 } } } ], "position": { "start": { "line": 18, "column": 1, "offset": 908 }, "end": { "line": 22, "column": 36, "offset": 1236 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 12, "column": 1, "offset": 577 }, "end": { "line": 22, "column": 36, "offset": 1236 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Leaderstats", "displayName": "Leaderstats", "description": "This code sample demonstrates the creation of leaderboard stat values in\nRoblox's default player list UI. It creates a \"Score\" leaderstat that starts\nat 0.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n\t-- Create a container for leaderstats\n\tlocal leaderstats = Instance.new(\"Folder\")\n\tleaderstats.Name = \"leaderstats\"\n\n\t-- Create one leaderstat value\n\tlocal vScore = Instance.new(\"IntValue\")\n\tvScore.Name = \"Score\"\n\tvScore.Value = 0\n\tvScore.Parent = leaderstats\n\n\t-- Add to player (displaying it)\n\tleaderstats.Parent = player\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "inherits": [ "Instance" ], "tags": [], "deprecationMessage": "", "properties": [ { "name": "Player.AccountAge", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Describes the player's account age in days.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The AccountAge is a ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 35, "offset": 34 } } }, { "type": "text", "value": " property that describes how long ago a\nplayer's account was registered in days. It is set using the\n", "position": { "start": { "line": 1, "column": 35, "offset": 34 }, "end": { "line": 3, "column": 1, "offset": 135 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:SetAccountAge()" } ], "position": { "start": { "line": 3, "column": 1, "offset": 135 }, "end": { "line": 3, "column": 31, "offset": 165 } } }, { "type": "text", "value": " function, which cannot be accessed by\nscripts.", "position": { "start": { "line": 3, "column": 31, "offset": 165 }, "end": { "line": 4, "column": 9, "offset": 212 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 9, "offset": 212 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property is useful for conditionally showing new Roblox players\ncontent such as tutorials.", "position": { "start": { "line": 6, "column": 1, "offset": 214 }, "end": { "line": 7, "column": 27, "offset": 309 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 214 }, "end": { "line": 7, "column": 27, "offset": 309 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Account-Age-Mark", "displayName": "Account Age Mark", "description": "This code sample adds a mark to players showing about how old their account\nis. The mark uses a player's account age to determine if they are a New\nPlayer, Veteran Player or Regular Player.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal MAX_AGE_NEW_PLAYER = 7 -- one week\nlocal MIN_AGE_VETERAN = 365 -- one year\n\n-- This function marks a part with text using a BillboardGui\nlocal function mark(part, text)\n\tlocal bbgui = Instance.new(\"BillboardGui\")\n\tbbgui.AlwaysOnTop = true\n\tbbgui.StudsOffsetWorldSpace = Vector3.new(0, 2, 0)\n\tbbgui.Size = UDim2.new(0, 200, 0, 50)\n\tlocal textLabel = Instance.new(\"TextLabel\")\n\ttextLabel.Size = UDim2.new(1, 0, 1, 0) -- Fill parent\n\ttextLabel.Text = text\n\ttextLabel.TextColor3 = Color3.new(1, 1, 1)\n\ttextLabel.TextStrokeTransparency = 0\n\ttextLabel.BackgroundTransparency = 1\n\ttextLabel.Parent = bbgui\n\t-- Add to part\n\tbbgui.Parent = part\n\tbbgui.Adornee = part\nend\n\nlocal function onPlayerSpawned(player, character)\n\tlocal head = character:WaitForChild(\"Head\")\n\tif player.AccountAge >= MIN_AGE_VETERAN then\n\t\tmark(head, \"Veteran Player\")\n\telseif player.AccountAge <= MAX_AGE_NEW_PLAYER then\n\t\tmark(head, \"New Player\")\n\telse\n\t\tmark(head, \"Regular Player\")\n\tend\nend\n\nlocal function onPlayerAdded(player)\n\t-- Listen for this player spawning\n\tif player.Character then\n\t\tonPlayerSpawned(player, player.Character)\n\tend\n\tplayer.CharacterAdded:Connect(function()\n\t\tonPlayerSpawned(player, player.Character)\n\tend)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "type": "int", "tags": [ "READ_ONLY", "NOT_REPLICATED" ], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Player.AutoJumpEnabled", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines whether the character of a player using a mobile device will\nautomatically jump upon hitting an obstacle.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 45, "offset": 116 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 45, "offset": 116 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The AutoJumpEnabled property determines whether the\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 52 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 2, "column": 1, "offset": 52 }, "end": { "line": 2, "column": 25, "offset": 76 } } }, { "type": "text", "value": " of a ", "position": { "start": { "line": 2, "column": 25, "offset": 76 }, "end": { "line": 2, "column": 31, "offset": 82 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 2, "column": 31, "offset": 82 }, "end": { "line": 2, "column": 45, "offset": 96 } } }, { "type": "text", "value": " using a mobile device will\nautomatically jump when they hit an obstacle. This can make levels more\nnavigable while on a mobile device.", "position": { "start": { "line": 2, "column": 45, "offset": 96 }, "end": { "line": 4, "column": 36, "offset": 231 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 36, "offset": 231 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When the player joins the game, the ", "position": { "start": { "line": 6, "column": 1, "offset": 233 }, "end": { "line": 6, "column": 37, "offset": 269 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.AutoJumpEnabled" } ], "position": { "start": { "line": 6, "column": 37, "offset": 269 }, "end": { "line": 6, "column": 74, "offset": 306 } } }, { "type": "text", "value": "\nvalue determines the initial state of this property. Then, this property\ndetermines the value of the ", "position": { "start": { "line": 6, "column": 74, "offset": 306 }, "end": { "line": 8, "column": 29, "offset": 408 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Humanoid.AutoJumpEnabled" } ], "position": { "start": { "line": 8, "column": 29, "offset": 408 }, "end": { "line": 8, "column": 61, "offset": 440 } } }, { "type": "text", "value": " property of\nthe ", "position": { "start": { "line": 8, "column": 61, "offset": 440 }, "end": { "line": 9, "column": 5, "offset": 457 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 9, "column": 5, "offset": 457 }, "end": { "line": 9, "column": 29, "offset": 481 } } }, { "type": "text", "value": " on spawn. In other words, it is possible to\nset the auto-jump behavior on a per-character, per-player and per-game\nbasis using these three properties.", "position": { "start": { "line": 9, "column": 29, "offset": 481 }, "end": { "line": 11, "column": 36, "offset": 632 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 233 }, "end": { "line": 11, "column": 36, "offset": 632 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Auto-Jump-Toggle", "displayName": "Auto-Jump Toggle", "description": "This code sample is meant for a TextButton. It allows the player to toggle the\nauto-jumping behavior while on a mobile device.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\nlocal button = script.Parent\n\nlocal function update()\n\t-- Update button text\n\tif player.AutoJumpEnabled then\n\t\tbutton.Text = \"Auto-Jump is ON\"\n\telse\n\t\tbutton.Text = \"Auto-Jump is OFF\"\n\tend\n\t-- Reflect the property in the player's character, if they have one\n\tif player.Character then\n\t\tlocal human = player.Character:FindFirstChild(\"Humanoid\")\n\t\tif human then\n\t\t\thuman.AutoJumpEnabled = player.AutoJumpEnabled\n\t\tend\n\tend\nend\n\nlocal function onActivated()\n\t-- Toggle auto-jump\n\tplayer.AutoJumpEnabled = not player.AutoJumpEnabled\n\t-- Update everything else\n\tupdate()\nend\n\nbutton.Activated:Connect(onActivated)\nupdate()", "expectedOutput": "", "highlightLines": "" } ], "type": "bool", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.CameraMaxZoomDistance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The maximum distance the player's camera is allowed to zoom out.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 65, "offset": 64 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 65, "offset": 64 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The CameraMaxZoomDistance ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 27, "offset": 26 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 27, "offset": 26 }, "end": { "line": 1, "column": 41, "offset": 40 } } }, { "type": "text", "value": " property sets the maximum\ndistance in studs the camera can be from the character with the default\ncameras.", "position": { "start": { "line": 1, "column": 41, "offset": 40 }, "end": { "line": 3, "column": 9, "offset": 147 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 9, "offset": 147 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "In other words, it controls the maximum distance the player's camera is\nallowed to zoom out.", "position": { "start": { "line": 5, "column": 1, "offset": 149 }, "end": { "line": 6, "column": 21, "offset": 241 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 149 }, "end": { "line": 6, "column": 21, "offset": 241 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The default value of this property is set by\n", "position": { "start": { "line": 8, "column": 1, "offset": 243 }, "end": { "line": 9, "column": 1, "offset": 288 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.CameraMaxZoomDistance" } ], "position": { "start": { "line": 9, "column": 1, "offset": 288 }, "end": { "line": 9, "column": 44, "offset": 331 } } }, { "type": "text", "value": ". If this value is set to a\nlower value than ", "position": { "start": { "line": 9, "column": 44, "offset": 331 }, "end": { "line": 10, "column": 18, "offset": 376 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.CameraMinZoomDistance" } ], "position": { "start": { "line": 10, "column": 18, "offset": 376 }, "end": { "line": 10, "column": 54, "offset": 412 } } }, { "type": "text", "value": ", it will be\nincreased to CameraMinZoomDistance.", "position": { "start": { "line": 10, "column": 54, "offset": 412 }, "end": { "line": 11, "column": 36, "offset": 460 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 243 }, "end": { "line": 11, "column": 36, "offset": 460 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "setting-camera-zoom-distance", "displayName": "Setting Camera Zoom Distance", "description": "​The example demonstrates how to set a player's camera minimum and maximum\nzoom distance.\n\nIn this example, we set the `Class.Player.CameraMinZoomDistance` and\n`Class.Player.CameraMaxZoomDistance` to set the min and max distance in studs\na player's camera can be from their character.\n\nNote that since the example attempts to set the CameraMinZoomDistance to be\ngreater than the CameraMaxZoomDistance, the CameraMinZoomDistance value will\nbe decreased and set to the value of the max zoom distance.\n\nTo change the default min and max zoom distance values for a player when they\nfirst enter the game, you can change the\n`StarterClass.Player.CameraMinZoomDistance` and\n`StarterClass.Player.CameraMaxZoomDistance` properties.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nplayer.CameraMaxZoomDistance = 50\nplayer.CameraMinZoomDistance = 75", "expectedOutput": "", "highlightLines": "" } ], "type": "float", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Camera", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.CameraMinZoomDistance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The minimum distance the player's camera is allowed to zoom in.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 64, "offset": 63 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 64, "offset": 63 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The CameraMinZoonDistance ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 27, "offset": 26 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 27, "offset": 26 }, "end": { "line": 1, "column": 41, "offset": 40 } } }, { "type": "text", "value": " property sets the minimum\ndistance in studs the camera can be from the character with the default\ncameras.", "position": { "start": { "line": 1, "column": 41, "offset": 40 }, "end": { "line": 3, "column": 9, "offset": 147 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 9, "offset": 147 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "In other words, it controls the minimum distance the player's camera is\nallowed to zoom in.", "position": { "start": { "line": 5, "column": 1, "offset": 149 }, "end": { "line": 6, "column": 20, "offset": 240 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 149 }, "end": { "line": 6, "column": 20, "offset": 240 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The default value of this property is set by\n", "position": { "start": { "line": 8, "column": 1, "offset": 242 }, "end": { "line": 9, "column": 1, "offset": 287 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.CameraMinZoomDistance" } ], "position": { "start": { "line": 9, "column": 1, "offset": 287 }, "end": { "line": 9, "column": 44, "offset": 330 } } }, { "type": "text", "value": ". If this value is set to a\nhigher value than ", "position": { "start": { "line": 9, "column": 44, "offset": 330 }, "end": { "line": 10, "column": 19, "offset": 376 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.CameraMaxZoomDistance" } ], "position": { "start": { "line": 10, "column": 19, "offset": 376 }, "end": { "line": 10, "column": 55, "offset": 412 } } }, { "type": "text", "value": " it will be\ndecreased to CameraMaxZoomDistance.", "position": { "start": { "line": 10, "column": 55, "offset": 412 }, "end": { "line": 11, "column": 36, "offset": 459 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 242 }, "end": { "line": 11, "column": 36, "offset": 459 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "setting-camera-zoom-distance", "displayName": "Setting Camera Zoom Distance", "description": "​The example demonstrates how to set a player's camera minimum and maximum\nzoom distance.\n\nIn this example, we set the `Class.Player.CameraMinZoomDistance` and\n`Class.Player.CameraMaxZoomDistance` to set the min and max distance in studs\na player's camera can be from their character.\n\nNote that since the example attempts to set the CameraMinZoomDistance to be\ngreater than the CameraMaxZoomDistance, the CameraMinZoomDistance value will\nbe decreased and set to the value of the max zoom distance.\n\nTo change the default min and max zoom distance values for a player when they\nfirst enter the game, you can change the\n`StarterClass.Player.CameraMinZoomDistance` and\n`StarterClass.Player.CameraMaxZoomDistance` properties.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nplayer.CameraMaxZoomDistance = 50\nplayer.CameraMinZoomDistance = 75", "expectedOutput": "", "highlightLines": "" } ], "type": "float", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Camera", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.CameraMode", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Changes the camera's mode to either first or third person.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The CameraMode ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 16, "offset": 15 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 16, "offset": 15 }, "end": { "line": 1, "column": 30, "offset": 29 } } }, { "type": "text", "value": " property sets what mode that the player's\ncamera is in. By default, the camera mode is set to third person.", "position": { "start": { "line": 1, "column": 30, "offset": 29 }, "end": { "line": 2, "column": 66, "offset": 137 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 66, "offset": 137 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The camera has two modes:", "position": { "start": { "line": 4, "column": 1, "offset": 139 }, "end": { "line": 4, "column": 26, "offset": 164 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 139 }, "end": { "line": 4, "column": 26, "offset": 164 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ol", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "First person", "position": { "start": { "line": 6, "column": 4, "offset": 169 }, "end": { "line": 6, "column": 16, "offset": 181 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 166 }, "end": { "line": 6, "column": 16, "offset": 181 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Third person", "position": { "start": { "line": 7, "column": 4, "offset": 185 }, "end": { "line": 7, "column": 16, "offset": 197 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 182 }, "end": { "line": 7, "column": 16, "offset": 197 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 6, "column": 1, "offset": 166 }, "end": { "line": 7, "column": 16, "offset": 197 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 9, "column": 1, "offset": 199 }, "end": { "line": 9, "column": 5, "offset": 203 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Enum.CameraMode" } ], "position": { "start": { "line": 9, "column": 5, "offset": 203 }, "end": { "line": 9, "column": 22, "offset": 220 } } }, { "type": "text", "value": " Enum is used to set CameraMode in Player, and\ndetermines when first and third person cameras should be used.", "position": { "start": { "line": 9, "column": 22, "offset": 220 }, "end": { "line": 10, "column": 63, "offset": 329 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 199 }, "end": { "line": 10, "column": 63, "offset": 329 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "First-person", "position": { "start": { "line": 12, "column": 6, "offset": 336 }, "end": { "line": 12, "column": 18, "offset": 348 } } } ], "position": { "start": { "line": 12, "column": 1, "offset": 331 }, "end": { "line": 12, "column": 18, "offset": 348 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "In first-person mode, the player's camera is zoomed all the way in. Unless\nthere is a visible GUI present with the ", "position": { "start": { "line": 14, "column": 1, "offset": 350 }, "end": { "line": 15, "column": 41, "offset": 465 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.GuiButton.Modal" } ], "position": { "start": { "line": 15, "column": 41, "offset": 465 }, "end": { "line": 15, "column": 64, "offset": 488 } } }, { "type": "text", "value": " property\nset to ", "position": { "start": { "line": 15, "column": 64, "offset": 488 }, "end": { "line": 16, "column": 8, "offset": 505 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "true", "position": { "start": { "line": 16, "column": 9, "offset": 506 }, "end": { "line": 16, "column": 13, "offset": 510 } } } ], "position": { "start": { "line": 16, "column": 8, "offset": 505 }, "end": { "line": 16, "column": 14, "offset": 511 } } }, { "type": "text", "value": ", the mouse will be locked and the user's camera will turn as\nthe mouse moves.", "position": { "start": { "line": 16, "column": 14, "offset": 511 }, "end": { "line": 17, "column": 17, "offset": 589 } } } ], "position": { "start": { "line": 14, "column": 1, "offset": 350 }, "end": { "line": 17, "column": 17, "offset": 589 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "img", "properties": { "src": "/assets/legacy/CameraMode-LockFirstPerson.jpg", "alt": "First Person CameraMode" }, "children": [], "position": { "start": { "line": 19, "column": 1, "offset": 591 }, "end": { "line": 19, "column": 74, "offset": 664 } } } ], "position": { "start": { "line": 19, "column": 1, "offset": 591 }, "end": { "line": 19, "column": 74, "offset": 664 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Third-person", "position": { "start": { "line": 21, "column": 6, "offset": 671 }, "end": { "line": 21, "column": 18, "offset": 683 } } } ], "position": { "start": { "line": 21, "column": 1, "offset": 666 }, "end": { "line": 21, "column": 18, "offset": 683 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "In third-person mode, the character can be seen in the camera. While in\nthird-person mode on Roblox:", "position": { "start": { "line": 23, "column": 1, "offset": 685 }, "end": { "line": 24, "column": 29, "offset": 785 } } } ], "position": { "start": { "line": 23, "column": 1, "offset": 685 }, "end": { "line": 24, "column": 29, "offset": 785 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "You may right-click and drag to rotate your camera, or use the arrow\nkeys at the bottom right-hand corner of the screen.", "position": { "start": { "line": 26, "column": 3, "offset": 789 }, "end": { "line": 27, "column": 54, "offset": 911 } } } ], "position": { "start": { "line": 26, "column": 1, "offset": 787 }, "end": { "line": 27, "column": 54, "offset": 911 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "When you move your mouse, your camera does not change (unless you move\nthe mouse to the end of the screen).", "position": { "start": { "line": 28, "column": 3, "offset": 914 }, "end": { "line": 29, "column": 39, "offset": 1023 } } } ], "position": { "start": { "line": 28, "column": 1, "offset": 912 }, "end": { "line": 29, "column": 39, "offset": 1023 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "When you press any of the arrow keys, the user's character will face in\nthe corresponding arrow key's direction.", "position": { "start": { "line": 30, "column": 3, "offset": 1026 }, "end": { "line": 31, "column": 43, "offset": 1140 } } } ], "position": { "start": { "line": 30, "column": 1, "offset": 1024 }, "end": { "line": 31, "column": 43, "offset": 1140 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "You can zoom in and out freely.", "position": { "start": { "line": 32, "column": 3, "offset": 1143 }, "end": { "line": 32, "column": 34, "offset": 1174 } } } ], "position": { "start": { "line": 32, "column": 1, "offset": 1141 }, "end": { "line": 32, "column": 34, "offset": 1174 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 26, "column": 1, "offset": 787 }, "end": { "line": 32, "column": 34, "offset": 1174 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Third-person is the default camera setting.", "position": { "start": { "line": 34, "column": 1, "offset": 1176 }, "end": { "line": 34, "column": 44, "offset": 1219 } } } ], "position": { "start": { "line": 34, "column": 1, "offset": 1176 }, "end": { "line": 34, "column": 44, "offset": 1219 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "img", "properties": { "src": "/assets/legacy/CameraMode-Classic.jpg", "alt": "Third Person CameraMode" }, "children": [], "position": { "start": { "line": 36, "column": 1, "offset": 1221 }, "end": { "line": 36, "column": 66, "offset": 1286 } } } ], "position": { "start": { "line": 36, "column": 1, "offset": 1221 }, "end": { "line": 36, "column": 66, "offset": 1286 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item should be used in a ", "position": { "start": { "line": 38, "column": 1, "offset": 1288 }, "end": { "line": 38, "column": 31, "offset": 1318 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 38, "column": 31, "offset": 1318 }, "end": { "line": 38, "column": 50, "offset": 1337 } } }, { "type": "text", "value": " to work as expected\nonline.", "position": { "start": { "line": 38, "column": 50, "offset": 1337 }, "end": { "line": 39, "column": 8, "offset": 1365 } } } ], "position": { "start": { "line": 38, "column": 1, "offset": 1288 }, "end": { "line": 39, "column": 8, "offset": 1365 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "playing-in-first-person", "displayName": "Playing in First Person", "description": "This example demonstrates how to change the character's CameraMode to first\nperson using the LockFirstPerson value of the `Enum.CameraMode` enum.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nplayer.CameraMode = Enum.CameraMode.LockFirstPerson", "expectedOutput": "", "highlightLines": "" }, { "identifier": "untitled", "displayName": "Playing in Third Person", "description": "This example demonstrates how to change the character's CameraMode to third\nperson using the Classic value of the `Enum.CameraMode` enum.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nplayer.CameraMode = Enum.CameraMode.Classic", "expectedOutput": "", "highlightLines": "" } ], "type": "CameraMode", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Camera", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.CanLoadCharacterAppearance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines whether the character's appearance will be loaded when the\nplayer spawns. If false, the player will spawn with a default appearance.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 74, "offset": 143 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 74, "offset": 143 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The CanLoadCharacterAppearance ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 32, "offset": 31 }, "end": { "line": 1, "column": 46, "offset": 45 } } }, { "type": "text", "value": " property determines whether\nthe character's appearance will be loaded when the player spawns. The\ndefault value of this property is set by\n", "position": { "start": { "line": 1, "column": 46, "offset": 45 }, "end": { "line": 4, "column": 1, "offset": 185 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.LoadPlayerAppearance" } ], "position": { "start": { "line": 4, "column": 1, "offset": 185 }, "end": { "line": 4, "column": 43, "offset": 227 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 4, "column": 43, "offset": 227 }, "end": { "line": 4, "column": 44, "offset": 228 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 44, "offset": 228 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If ", "position": { "start": { "line": 6, "column": 1, "offset": 230 }, "end": { "line": 6, "column": 4, "offset": 233 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "true", "position": { "start": { "line": 6, "column": 5, "offset": 234 }, "end": { "line": 6, "column": 9, "offset": 238 } } } ], "position": { "start": { "line": 6, "column": 4, "offset": 233 }, "end": { "line": 6, "column": 10, "offset": 239 } } }, { "type": "text", "value": ", the character will load the appearance of the player\ncorresponding to the player's ", "position": { "start": { "line": 6, "column": 10, "offset": 239 }, "end": { "line": 7, "column": 31, "offset": 324 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.CharacterAppearanceId" } ], "position": { "start": { "line": 7, "column": 31, "offset": 324 }, "end": { "line": 7, "column": 67, "offset": 360 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 7, "column": 67, "offset": 360 }, "end": { "line": 7, "column": 68, "offset": 361 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 230 }, "end": { "line": 7, "column": 68, "offset": 361 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If ", "position": { "start": { "line": 9, "column": 1, "offset": 363 }, "end": { "line": 9, "column": 4, "offset": 366 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "false", "position": { "start": { "line": 9, "column": 5, "offset": 367 }, "end": { "line": 9, "column": 10, "offset": 372 } } } ], "position": { "start": { "line": 9, "column": 4, "offset": 366 }, "end": { "line": 9, "column": 11, "offset": 373 } } }, { "type": "text", "value": ", the player will spawn with a default appearance - a grey\ncharacter model without any hats, shirts, pants, etc.", "position": { "start": { "line": 9, "column": 11, "offset": 373 }, "end": { "line": 10, "column": 54, "offset": 485 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 363 }, "end": { "line": 10, "column": 54, "offset": 485 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Attempting to set the property after the character has spawned will not\nchange the character, you must call ", "position": { "start": { "line": 12, "column": 1, "offset": 487 }, "end": { "line": 13, "column": 37, "offset": 595 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadCharacter()" } ], "position": { "start": { "line": 13, "column": 37, "offset": 595 }, "end": { "line": 13, "column": 67, "offset": 625 } } }, { "type": "text", "value": " to load\nthe new appearance.", "position": { "start": { "line": 13, "column": 67, "offset": 625 }, "end": { "line": 14, "column": 20, "offset": 653 } } } ], "position": { "start": { "line": 12, "column": 1, "offset": 487 }, "end": { "line": 14, "column": 20, "offset": 653 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "disabling-a-player-s-appearance", "displayName": "Disabling a Player's Appearance", "description": "This example demonstrates how to disable loading a player's character\nappearance. Instead, the player loads as a grey model without any hats,\nshirts, pants, etc.\n\nThis is useful for games using custom clothing and accessories.\n\nNote that if the character has already spawned, this change will not take affect\nuntil the player respawns or the `Class.Player:LoadCharacter()` function is\ncalled.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nplayer.CanLoadCharacterAppearance = false", "expectedOutput": "", "highlightLines": "" } ], "type": "bool", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Behavior", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Player.Character", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 3, "offset": 2 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Model" } ], "position": { "start": { "line": 1, "column": 3, "offset": 2 }, "end": { "line": 1, "column": 16, "offset": 15 } } }, { "type": "text", "value": " controlled by the player that contains a ", "position": { "start": { "line": 1, "column": 16, "offset": 15 }, "end": { "line": 1, "column": 58, "offset": 57 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Humanoid" } ], "position": { "start": { "line": 1, "column": 58, "offset": 57 }, "end": { "line": 1, "column": 74, "offset": 73 } } }, { "type": "text", "value": ",\nbody parts, scripts and other objects.", "position": { "start": { "line": 1, "column": 74, "offset": 73 }, "end": { "line": 2, "column": 39, "offset": 113 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 39, "offset": 113 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The Character property contains a reference to a ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 50, "offset": 49 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Model" } ], "position": { "start": { "line": 1, "column": 50, "offset": 49 }, "end": { "line": 1, "column": 63, "offset": 62 } } }, { "type": "text", "value": " containing\na ", "position": { "start": { "line": 1, "column": 63, "offset": 62 }, "end": { "line": 2, "column": 3, "offset": 76 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Humanoid" } ], "position": { "start": { "line": 2, "column": 3, "offset": 76 }, "end": { "line": 2, "column": 19, "offset": 92 } } }, { "type": "text", "value": ", body parts, scripts and other objects required for\nsimulating the player's avatar in-game. The model is parented to the\n", "position": { "start": { "line": 2, "column": 19, "offset": 92 }, "end": { "line": 4, "column": 1, "offset": 214 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Workspace" } ], "position": { "start": { "line": 4, "column": 1, "offset": 214 }, "end": { "line": 4, "column": 18, "offset": 231 } } }, { "type": "text", "value": ", but may be moved. It is automatically loaded when\n", "position": { "start": { "line": 4, "column": 18, "offset": 231 }, "end": { "line": 5, "column": 1, "offset": 283 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players.CharacterAutoLoads" } ], "position": { "start": { "line": 5, "column": 1, "offset": 283 }, "end": { "line": 5, "column": 35, "offset": 317 } } }, { "type": "text", "value": " is true, but can be manually loaded\notherwise using ", "position": { "start": { "line": 5, "column": 35, "offset": 317 }, "end": { "line": 6, "column": 17, "offset": 370 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadCharacter()" } ], "position": { "start": { "line": 6, "column": 17, "offset": 370 }, "end": { "line": 6, "column": 47, "offset": 400 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 6, "column": 47, "offset": 400 }, "end": { "line": 6, "column": 48, "offset": 401 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 6, "column": 48, "offset": 401 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Initially, this property is nil then set when the player's character first\nspawns. Use the ", "position": { "start": { "line": 8, "column": 1, "offset": 403 }, "end": { "line": 9, "column": 17, "offset": 494 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.CharacterAdded" } ], "position": { "start": { "line": 9, "column": 17, "offset": 494 }, "end": { "line": 9, "column": 46, "offset": 523 } } }, { "type": "text", "value": " event to detect when a\nplayer's character properly loads, and the\n", "position": { "start": { "line": 9, "column": 46, "offset": 523 }, "end": { "line": 11, "column": 1, "offset": 590 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.CharacterRemoving" } ], "position": { "start": { "line": 11, "column": 1, "offset": 590 }, "end": { "line": 11, "column": 33, "offset": 622 } } }, { "type": "text", "value": " event to detect when the character is\nabout to despawn. Avoid using ", "position": { "start": { "line": 11, "column": 33, "offset": 622 }, "end": { "line": 12, "column": 31, "offset": 691 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetPropertyChangedSignal()" } ], "position": { "start": { "line": 12, "column": 31, "offset": 691 }, "end": { "line": 12, "column": 74, "offset": 734 } } }, { "type": "text", "value": "\non this property.", "position": { "start": { "line": 12, "column": 74, "offset": 734 }, "end": { "line": 13, "column": 18, "offset": 752 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 403 }, "end": { "line": 13, "column": 18, "offset": 752 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note: LocalScripts that are cloned from ", "position": { "start": { "line": 15, "column": 1, "offset": 754 }, "end": { "line": 15, "column": 41, "offset": 794 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterGui" } ], "position": { "start": { "line": 15, "column": 41, "offset": 794 }, "end": { "line": 15, "column": 59, "offset": 812 } } }, { "type": "text", "value": " or\n", "position": { "start": { "line": 15, "column": 59, "offset": 812 }, "end": { "line": 16, "column": 1, "offset": 816 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPack" } ], "position": { "start": { "line": 16, "column": 1, "offset": 816 }, "end": { "line": 16, "column": 20, "offset": 835 } } }, { "type": "text", "value": " into a player's ", "position": { "start": { "line": 16, "column": 20, "offset": 835 }, "end": { "line": 16, "column": 37, "offset": 852 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Backpack" } ], "position": { "start": { "line": 16, "column": 37, "offset": 852 }, "end": { "line": 16, "column": 53, "offset": 868 } } }, { "type": "text", "value": " or ", "position": { "start": { "line": 16, "column": 53, "offset": 868 }, "end": { "line": 16, "column": 57, "offset": 872 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.PlayerGui" } ], "position": { "start": { "line": 16, "column": 57, "offset": 872 }, "end": { "line": 16, "column": 74, "offset": 889 } } }, { "type": "text", "value": "\nare often run before the old Character model is deleted. Player.Character\nstill refers to a model, but that model's parent is nil and it has been\ndestroyed. Because of this, if the Character already exists, you should\ncheck to make sure that the Character's parent is not nil before using it.", "position": { "start": { "line": 16, "column": 74, "offset": 889 }, "end": { "line": 20, "column": 75, "offset": 1182 } } } ], "position": { "start": { "line": 15, "column": 1, "offset": 754 }, "end": { "line": 20, "column": 75, "offset": 1182 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "So if you're writing a ", "position": { "start": { "line": 22, "column": 1, "offset": 1184 }, "end": { "line": 22, "column": 24, "offset": 1207 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 22, "column": 24, "offset": 1207 }, "end": { "line": 22, "column": 43, "offset": 1226 } } }, { "type": "text", "value": " under the ", "position": { "start": { "line": 22, "column": 43, "offset": 1226 }, "end": { "line": 22, "column": 54, "offset": 1237 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterGui" } ], "position": { "start": { "line": 22, "column": 54, "offset": 1237 }, "end": { "line": 22, "column": 72, "offset": 1255 } } }, { "type": "text", "value": " or\n", "position": { "start": { "line": 22, "column": 72, "offset": 1255 }, "end": { "line": 23, "column": 1, "offset": 1259 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPack" } ], "position": { "start": { "line": 23, "column": 1, "offset": 1259 }, "end": { "line": 23, "column": 20, "offset": 1278 } } }, { "type": "text", "value": " that requires access to the player's character, use\nthis:", "position": { "start": { "line": 23, "column": 20, "offset": 1278 }, "end": { "line": 24, "column": 6, "offset": 1336 } } } ], "position": { "start": { "line": 22, "column": 1, "offset": 1184 }, "end": { "line": 24, "column": 6, "offset": 1336 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local Players = game:GetService(\"Players\")\nlocal player = Players.LocalPlayer\nlocal character = player.Character\nif not character or not character.Parent then\n character = player.CharacterAdded:wait()\nend\n" } ], "position": { "start": { "line": 26, "column": 1, "offset": 1338 }, "end": { "line": 33, "column": 4, "offset": 1556 } } } ], "position": { "start": { "line": 26, "column": 1, "offset": 1338 }, "end": { "line": 33, "column": 4, "offset": 1556 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "type": "Model", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.CharacterAppearance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The URL of the asset containing the character's appearance, clothing, and\ngear.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 6, "offset": 79 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 6, "offset": 79 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The CharacterAppearance property indicates the URL of the asset containing\nthe character's appearance, clothing, and gear.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 48, "offset": 122 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 48, "offset": 122 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "It is automatically set by Roblox to load your avatar's appearance when\nyou join a game.", "position": { "start": { "line": 4, "column": 1, "offset": 124 }, "end": { "line": 5, "column": 17, "offset": 212 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 124 }, "end": { "line": 5, "column": 17, "offset": 212 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Attempting to set the property after the character has spawned will not\nchange the character, you must call ", "position": { "start": { "line": 7, "column": 1, "offset": 214 }, "end": { "line": 8, "column": 37, "offset": 322 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadCharacter()" } ], "position": { "start": { "line": 8, "column": 37, "offset": 322 }, "end": { "line": 8, "column": 67, "offset": 352 } } }, { "type": "text", "value": " to load\nthe new appearance.", "position": { "start": { "line": 8, "column": 67, "offset": 352 }, "end": { "line": 9, "column": 20, "offset": 380 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 214 }, "end": { "line": 9, "column": 20, "offset": 380 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "type": "string", "tags": [ "NOT_BROWSABLE", "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated. Do not use it for new work.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 53, "offset": 52 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 53, "offset": 52 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.CharacterAppearanceId", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines the user ID of the account whose character appearance is used\nfor a player's ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 16, "offset": 88 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character|character" } ], "position": { "start": { "line": 2, "column": 16, "offset": 88 }, "end": { "line": 2, "column": 50, "offset": 122 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 2, "column": 50, "offset": 122 }, "end": { "line": 2, "column": 51, "offset": 123 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 51, "offset": 123 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property determines the user ID of the account whose character\nappearance is used for a player's ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 35, "offset": 102 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 2, "column": 35, "offset": 102 }, "end": { "line": 2, "column": 59, "offset": 126 } } }, { "type": "text", "value": ". By default,\nthis property is the ", "position": { "start": { "line": 2, "column": 59, "offset": 126 }, "end": { "line": 3, "column": 22, "offset": 161 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.UserId" } ], "position": { "start": { "line": 3, "column": 22, "offset": 161 }, "end": { "line": 3, "column": 43, "offset": 182 } } }, { "type": "text", "value": ", which uses the player's avatar\nas they have created it on the Roblox website.", "position": { "start": { "line": 3, "column": 43, "offset": 182 }, "end": { "line": 4, "column": 47, "offset": 261 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 47, "offset": 261 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Changing this property to the user ID of another account will cause the\nplayer to spawn with that account's appearance (hats, shirt, pants, etc).", "position": { "start": { "line": 6, "column": 1, "offset": 263 }, "end": { "line": 7, "column": 74, "offset": 408 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 263 }, "end": { "line": 7, "column": 74, "offset": 408 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Games can also toggle whether or not a player's character appearance is\nloaded in game by changing the\n", "position": { "start": { "line": 9, "column": 1, "offset": 410 }, "end": { "line": 11, "column": 1, "offset": 513 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.LoadCharacterAppearance" } ], "position": { "start": { "line": 11, "column": 1, "offset": 513 }, "end": { "line": 11, "column": 46, "offset": 558 } } }, { "type": "text", "value": " property.", "position": { "start": { "line": 11, "column": 46, "offset": 558 }, "end": { "line": 11, "column": 56, "offset": 568 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 410 }, "end": { "line": 11, "column": 56, "offset": 568 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Disguise-Command", "displayName": "Disguise Command", "description": "This code sample allows players to chat \"/disguise xyz\", where xyz is a user\nID or username, and they will respawn appearing like that account's avatar.\nTry typing \"/disguise 261\" or \"/disguise Shedletsky\"!\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal disguiseCommand = \"/disguise \"\n\nlocal function onPlayerChatted(player, message)\n\tif message:sub(1, disguiseCommand:len()):lower() == disguiseCommand:lower() then\n\t\tlocal input = message:sub(disguiseCommand:len() + 1)\n\t\tlocal id = tonumber(input)\n\t\tif not id then -- Number failed to parse, maybe they typed a username instead\n\t\t\tpcall(function() -- This call can fail sometimes!\n\t\t\t\tid = Players:GetUserIdFromNameAsync(input) -- Fetch ID from name\n\t\t\tend)\n\t\tend\n\t\tif id then\n\t\t\t-- Set character appearance then respawn\n\t\t\tplayer.CharacterAppearanceId = id\n\t\t\tplayer:LoadCharacter()\n\t\telse\n\t\t\t-- We couldn't get an ID from their input\n\t\tend\n\tend\nend\n\nlocal function onPlayerAdded(player)\n\tplayer.Chatted:Connect(function(...)\n\t\tonPlayerChatted(player, ...)\n\tend)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "type": "int64", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.DataComplexity", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The total amount of data currently being stored in the\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 55 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player|Player's" } ], "position": { "start": { "line": 2, "column": 1, "offset": 55 }, "end": { "line": 2, "column": 24, "offset": 78 } } }, { "type": "text", "value": " cache on the current place.", "position": { "start": { "line": 2, "column": 24, "offset": 78 }, "end": { "line": 2, "column": 52, "offset": 106 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 52, "offset": 106 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property was once used by an ancient data persistence method to\nindicate the total amount of data currently being stored in the\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 133 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player|Player's" } ], "position": { "start": { "line": 3, "column": 1, "offset": 133 }, "end": { "line": 3, "column": 24, "offset": 156 } } }, { "type": "text", "value": " cache on the current place.", "position": { "start": { "line": 3, "column": 24, "offset": 156 }, "end": { "line": 3, "column": 52, "offset": 184 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 52, "offset": 184 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note:", "position": { "start": { "line": 5, "column": 1, "offset": 186 }, "end": { "line": 5, "column": 6, "offset": 191 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 186 }, "end": { "line": 5, "column": 6, "offset": 191 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Booleans and numbers cost 1 data complexity unit.", "position": { "start": { "line": 7, "column": 3, "offset": 195 }, "end": { "line": 7, "column": 52, "offset": 244 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 193 }, "end": { "line": 7, "column": 52, "offset": 244 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Strings cost their length divided by 100 in data complexity units.", "position": { "start": { "line": 8, "column": 3, "offset": 247 }, "end": { "line": 8, "column": 69, "offset": 313 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 245 }, "end": { "line": 8, "column": 69, "offset": 313 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Instances cost their DataCost in data complexity units.", "position": { "start": { "line": 9, "column": 3, "offset": 316 }, "end": { "line": 9, "column": 58, "offset": 371 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 314 }, "end": { "line": 9, "column": 58, "offset": 371 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Saving the default value (0 for numbers, false for booleans, \"\" for\nstrings and nil for Instances) removes the key from the DataComplexity\ncount.", "position": { "start": { "line": 10, "column": 3, "offset": 374 }, "end": { "line": 12, "column": 9, "offset": 523 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 372 }, "end": { "line": 12, "column": 9, "offset": 523 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "If, when using the SaveBoolean, SaveString, SaveNumber or SaveInstance\nfunctions, the DataComplexity for the player goes over the limit\n(currently 45000 units, defined by DataComplexityLimit), the function\nthrows an error, the value is not saved, and any previous value of the\nkey that was being saved to is deleted.", "position": { "start": { "line": 13, "column": 3, "offset": 526 }, "end": { "line": 17, "column": 42, "offset": 850 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 524 }, "end": { "line": 17, "column": 42, "offset": 850 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 7, "column": 1, "offset": 193 }, "end": { "line": 17, "column": 42, "offset": 850 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "type": "int", "tags": [ "HIDDEN", "READ_ONLY", "NOT_REPLICATED", "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated, as it may have been used for a now obsolete data\npersistence method. Please save and load player data using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 133 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataStoreService" } ], "position": { "start": { "line": 3, "column": 1, "offset": 133 }, "end": { "line": 3, "column": 25, "offset": 157 } } }, { "type": "text", "value": " for new work.", "position": { "start": { "line": 3, "column": 25, "offset": 157 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Player.DataReady", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Indicates when the player's data is available to load.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 55, "offset": 54 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 55, "offset": 54 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property was once used by an ancient data persistence method to\nindicate when the player's data is available to load. Becomes true when\ndata is available.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 19, "offset": 159 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 19, "offset": 159 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "type": "bool", "tags": [ "HIDDEN", "READ_ONLY", "NOT_REPLICATED", "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated, as it may have been used for a now obsolete data\npersistence method. Please save and load player data using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 133 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataStoreService" } ], "position": { "start": { "line": 3, "column": 1, "offset": 133 }, "end": { "line": 3, "column": 25, "offset": 157 } } }, { "type": "text", "value": " for new work.", "position": { "start": { "line": 3, "column": 25, "offset": 157 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Player.DevCameraOcclusionMode", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Sets how the default camera handles objects between the camera and the\nplayer.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 8, "offset": 78 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 8, "offset": 78 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Defines how the default camera scripts handle objects between the camera\nand the camera subject. Set by\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 104 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.DevCameraOcclusionMode" } ], "position": { "start": { "line": 3, "column": 1, "offset": 104 }, "end": { "line": 3, "column": 45, "offset": 148 } } }, { "type": "text", "value": " and can't be changed for\nindividual players.", "position": { "start": { "line": 3, "column": 45, "offset": 148 }, "end": { "line": 4, "column": 20, "offset": 193 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 20, "offset": 193 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The default value is ", "position": { "start": { "line": 6, "column": 1, "offset": 195 }, "end": { "line": 6, "column": 22, "offset": 216 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Enum.DevCameraOcclusionMode|Zoom" } ], "position": { "start": { "line": 6, "column": 22, "offset": 216 }, "end": { "line": 6, "column": 56, "offset": 250 } } }, { "type": "text", "value": " (0). See\n", "position": { "start": { "line": 6, "column": 56, "offset": 250 }, "end": { "line": 7, "column": 1, "offset": 260 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Enum.DevCameraOcclusionMode" } ], "position": { "start": { "line": 7, "column": 1, "offset": 260 }, "end": { "line": 7, "column": 30, "offset": 289 } } }, { "type": "text", "value": " for a list of available modes.", "position": { "start": { "line": 7, "column": 30, "offset": 289 }, "end": { "line": 7, "column": 61, "offset": 320 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 195 }, "end": { "line": 7, "column": 61, "offset": 320 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [], "type": "DevCameraOcclusionMode", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Camera", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.DevComputerCameraMode", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines player's camera movement mode when using a desktop version of\nRoblox.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 8, "offset": 80 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 8, "offset": 80 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The DevComputerCameraMode property determines the manner in which a player\nmoves their camera when using a device with a mouse and keyboard. See\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 145 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Enum.DevComputerCameraMovementMode" } ], "position": { "start": { "line": 3, "column": 1, "offset": 145 }, "end": { "line": 3, "column": 37, "offset": 181 } } }, { "type": "text", "value": " for a description of each camera\ncontrol mode available. This property cannot be set using a\n", "position": { "start": { "line": 3, "column": 37, "offset": 181 }, "end": { "line": 5, "column": 1, "offset": 275 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 5, "column": 1, "offset": 275 }, "end": { "line": 5, "column": 20, "offset": 294 } } }, { "type": "text", "value": " (it must be set on the server using a ", "position": { "start": { "line": 5, "column": 20, "offset": 294 }, "end": { "line": 5, "column": 59, "offset": 333 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Script" } ], "position": { "start": { "line": 5, "column": 59, "offset": 333 }, "end": { "line": 5, "column": 73, "offset": 347 } } }, { "type": "text", "value": ").", "position": { "start": { "line": 5, "column": 73, "offset": 347 }, "end": { "line": 5, "column": 75, "offset": 349 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 5, "column": 75, "offset": 349 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The default value of this property is determined by\n", "position": { "start": { "line": 7, "column": 1, "offset": 351 }, "end": { "line": 8, "column": 1, "offset": 403 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.DevComputerCameraMovementMode" } ], "position": { "start": { "line": 8, "column": 1, "offset": 403 }, "end": { "line": 8, "column": 52, "offset": 454 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 8, "column": 52, "offset": 454 }, "end": { "line": 8, "column": 53, "offset": 455 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 351 }, "end": { "line": 8, "column": 53, "offset": 455 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The word \"Computer\" in this property name refers to\nnon-", "position": { "start": { "line": 10, "column": 1, "offset": 457 }, "end": { "line": 11, "column": 5, "offset": 513 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.UserInputService.TouchEnabled|TouchEnabled" } ], "position": { "start": { "line": 11, "column": 5, "offset": 513 }, "end": { "line": 11, "column": 55, "offset": 563 } } }, { "type": "text", "value": ",\nnon-", "position": { "start": { "line": 11, "column": 55, "offset": 563 }, "end": { "line": 12, "column": 5, "offset": 569 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.UserInputService.GamepadEnabled|GamepadEnabled" } ], "position": { "start": { "line": 12, "column": 5, "offset": 569 }, "end": { "line": 12, "column": 59, "offset": 623 } } }, { "type": "text", "value": " devices.", "position": { "start": { "line": 12, "column": 59, "offset": 623 }, "end": { "line": 12, "column": 68, "offset": 632 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 457 }, "end": { "line": 12, "column": 68, "offset": 632 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When set to ", "position": { "start": { "line": 14, "column": 1, "offset": 634 }, "end": { "line": 14, "column": 13, "offset": 646 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "UserChoice", "position": { "start": { "line": 14, "column": 15, "offset": 648 }, "end": { "line": 14, "column": 25, "offset": 658 } } } ], "position": { "start": { "line": 14, "column": 13, "offset": 646 }, "end": { "line": 14, "column": 27, "offset": 660 } } }, { "type": "text", "value": ", a player can choose between any control mode\n(except ", "position": { "start": { "line": 14, "column": 27, "offset": 660 }, "end": { "line": 15, "column": 9, "offset": 715 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Scriptable", "position": { "start": { "line": 15, "column": 11, "offset": 717 }, "end": { "line": 15, "column": 21, "offset": 727 } } } ], "position": { "start": { "line": 15, "column": 9, "offset": 715 }, "end": { "line": 15, "column": 23, "offset": 729 } } }, { "type": "text", "value": ") in the Roblox game settings. In general, it's a\ngood idea to allow players to choose their control mode to maximize\naccessibility.", "position": { "start": { "line": 15, "column": 23, "offset": 729 }, "end": { "line": 17, "column": 15, "offset": 861 } } } ], "position": { "start": { "line": 14, "column": 1, "offset": 634 }, "end": { "line": 17, "column": 15, "offset": 861 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "It's possible to create a custom control scheme by setting this property\nto ", "position": { "start": { "line": 19, "column": 1, "offset": 863 }, "end": { "line": 20, "column": 4, "offset": 939 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Scriptable", "position": { "start": { "line": 20, "column": 6, "offset": 941 }, "end": { "line": 20, "column": 16, "offset": 951 } } } ], "position": { "start": { "line": 20, "column": 4, "offset": 939 }, "end": { "line": 20, "column": 18, "offset": 953 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 20, "column": 18, "offset": 953 }, "end": { "line": 20, "column": 19, "offset": 954 } } } ], "position": { "start": { "line": 19, "column": 1, "offset": 863 }, "end": { "line": 20, "column": 19, "offset": 954 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property doesn't affect players using a touch enabled device. See\n", "position": { "start": { "line": 22, "column": 1, "offset": 956 }, "end": { "line": 23, "column": 1, "offset": 1027 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.DevTouchCameraMode" } ], "position": { "start": { "line": 23, "column": 1, "offset": 1027 }, "end": { "line": 23, "column": 34, "offset": 1060 } } }, { "type": "text", "value": " instead.", "position": { "start": { "line": 23, "column": 34, "offset": 1060 }, "end": { "line": 23, "column": 43, "offset": 1069 } } } ], "position": { "start": { "line": 22, "column": 1, "offset": 956 }, "end": { "line": 23, "column": 43, "offset": 1069 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "setting-a-player-s-camera-movement-mode-desktop-", "displayName": "Setting a Player's Camera Movement Mode (Desktop)", "description": "The example demonstrates how to set a player's camera movement mode for\nplayers on a computer.\n\nIn this example, we set the camera movement mode to Classic via the\n`Enum.DevComputerCameraMovementMode` enum. This means that the camera of\nplayers on touch enabled devices will track the player but will not\nautomatically rotate if the player walks left or right.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\n-- Set the player's camera movement mode on computers to classic\nplayer.DevComputerCameraMode = Enum.DevComputerCameraMovementMode.Classic", "expectedOutput": "", "highlightLines": "" } ], "type": "DevComputerCameraMovementMode", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Camera", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.DevComputerMovementMode", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines player's character movement mode when using a desktop version\nof Roblox.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 11, "offset": 83 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 11, "offset": 83 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The DevComputerMovementMode property determines the manner in which a\nplayer moves their character when using a device with a mouse and\nkeyboard. See ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 15, "offset": 150 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Enum.DevComputerMovementMode" } ], "position": { "start": { "line": 3, "column": 15, "offset": 150 }, "end": { "line": 3, "column": 45, "offset": 180 } } }, { "type": "text", "value": " for a description of each\nmovement control mode available. This property cannot be set using a\n", "position": { "start": { "line": 3, "column": 45, "offset": 180 }, "end": { "line": 5, "column": 1, "offset": 276 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 5, "column": 1, "offset": 276 }, "end": { "line": 5, "column": 20, "offset": 295 } } }, { "type": "text", "value": " (it must be set on the server using a ", "position": { "start": { "line": 5, "column": 20, "offset": 295 }, "end": { "line": 5, "column": 59, "offset": 334 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Script" } ], "position": { "start": { "line": 5, "column": 59, "offset": 334 }, "end": { "line": 5, "column": 73, "offset": 348 } } }, { "type": "text", "value": ").", "position": { "start": { "line": 5, "column": 73, "offset": 348 }, "end": { "line": 5, "column": 75, "offset": 350 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 5, "column": 75, "offset": 350 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The default value of this property is determined by\n", "position": { "start": { "line": 7, "column": 1, "offset": 352 }, "end": { "line": 8, "column": 1, "offset": 404 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.DevComputerMovementMode" } ], "position": { "start": { "line": 8, "column": 1, "offset": 404 }, "end": { "line": 8, "column": 46, "offset": 449 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 8, "column": 46, "offset": 449 }, "end": { "line": 8, "column": 47, "offset": 450 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 352 }, "end": { "line": 8, "column": 47, "offset": 450 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The word \"Computer\" in this property name refers to\nnon-", "position": { "start": { "line": 10, "column": 1, "offset": 452 }, "end": { "line": 11, "column": 5, "offset": 508 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.UserInputService.TouchEnabled|TouchEnabled" } ], "position": { "start": { "line": 11, "column": 5, "offset": 508 }, "end": { "line": 11, "column": 55, "offset": 558 } } }, { "type": "text", "value": " devices.", "position": { "start": { "line": 11, "column": 55, "offset": 558 }, "end": { "line": 11, "column": 64, "offset": 567 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 452 }, "end": { "line": 11, "column": 64, "offset": 567 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When set to ", "position": { "start": { "line": 13, "column": 1, "offset": 569 }, "end": { "line": 13, "column": 13, "offset": 581 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "UserChoice", "position": { "start": { "line": 13, "column": 15, "offset": 583 }, "end": { "line": 13, "column": 25, "offset": 593 } } } ], "position": { "start": { "line": 13, "column": 13, "offset": 581 }, "end": { "line": 13, "column": 27, "offset": 595 } } }, { "type": "text", "value": ", a player can choose between any control mode\n(except ", "position": { "start": { "line": 13, "column": 27, "offset": 595 }, "end": { "line": 14, "column": 9, "offset": 650 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Scriptable", "position": { "start": { "line": 14, "column": 11, "offset": 652 }, "end": { "line": 14, "column": 21, "offset": 662 } } } ], "position": { "start": { "line": 14, "column": 9, "offset": 650 }, "end": { "line": 14, "column": 23, "offset": 664 } } }, { "type": "text", "value": ") in the Roblox game settings. In general, it is a\ngood idea to allow players to choose their control mode to maximize\naccessibility.", "position": { "start": { "line": 14, "column": 23, "offset": 664 }, "end": { "line": 16, "column": 15, "offset": 797 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 569 }, "end": { "line": 16, "column": 15, "offset": 797 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "It's possible to create a custom control scheme by setting this property\nto ", "position": { "start": { "line": 18, "column": 1, "offset": 799 }, "end": { "line": 19, "column": 4, "offset": 875 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Scriptable", "position": { "start": { "line": 19, "column": 6, "offset": 877 }, "end": { "line": 19, "column": 16, "offset": 887 } } } ], "position": { "start": { "line": 19, "column": 4, "offset": 875 }, "end": { "line": 19, "column": 18, "offset": 889 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 19, "column": 18, "offset": 889 }, "end": { "line": 19, "column": 19, "offset": 890 } } } ], "position": { "start": { "line": 18, "column": 1, "offset": 799 }, "end": { "line": 19, "column": 19, "offset": 890 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property doesn't affect players using a touch-enabled device. See\n", "position": { "start": { "line": 21, "column": 1, "offset": 892 }, "end": { "line": 22, "column": 1, "offset": 963 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.DevTouchMovementMode" } ], "position": { "start": { "line": 22, "column": 1, "offset": 963 }, "end": { "line": 22, "column": 36, "offset": 998 } } }, { "type": "text", "value": " instead.", "position": { "start": { "line": 22, "column": 36, "offset": 998 }, "end": { "line": 22, "column": 45, "offset": 1007 } } } ], "position": { "start": { "line": 21, "column": 1, "offset": 892 }, "end": { "line": 22, "column": 45, "offset": 1007 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "setting-a-player-s-movement-mode-desktop-", "displayName": "Setting a Player's Movement Mode (Desktop)", "description": "The example demonstrates how to set the movement mode for players on\ncomputers.\n\nIn this example, we set the movement mode to KeyboardMouse via the\n`Enum.DevComputerMovementMode` enum. This means that players on computers can\ncontrol their characters using their keyboard and mouse.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\ngame.Players.PlayerAdded:Connect(function(player)\n -- Set the player's movement mode on mobile devices to a dynamic thumbstick\n player.DevComputerMovementMode = Enum.DevComputerMovementMode.DynamicThumbstick\nend)", "expectedOutput": "", "highlightLines": "" } ], "type": "DevComputerMovementMode", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Control", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.DevEnableMouseLock", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines if the player can toggle mouse lock.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 48, "offset": 47 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 48, "offset": 47 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property determines if a player is able to toggle ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 56, "offset": 55 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Mouse" } ], "position": { "start": { "line": 1, "column": 56, "offset": 55 }, "end": { "line": 1, "column": 69, "offset": 68 } } }, { "type": "text", "value": " lock\nby pressing ", "position": { "start": { "line": 1, "column": 69, "offset": 68 }, "end": { "line": 2, "column": 13, "offset": 86 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Shift", "position": { "start": { "line": 2, "column": 15, "offset": 88 }, "end": { "line": 2, "column": 20, "offset": 93 } } } ], "position": { "start": { "line": 2, "column": 13, "offset": 86 }, "end": { "line": 2, "column": 22, "offset": 95 } } }, { "type": "text", "value": ". A player can disable the mouse lock switch in\nRoblox's game settings. By default, this property is set to the value of\n", "position": { "start": { "line": 2, "column": 22, "offset": 95 }, "end": { "line": 4, "column": 1, "offset": 216 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.EnableMouseLockOption" } ], "position": { "start": { "line": 4, "column": 1, "offset": 216 }, "end": { "line": 4, "column": 44, "offset": 259 } } }, { "type": "text", "value": ". This can be set server-side\nduring run-time by using a ", "position": { "start": { "line": 4, "column": 44, "offset": 259 }, "end": { "line": 5, "column": 28, "offset": 316 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Script" } ], "position": { "start": { "line": 5, "column": 28, "offset": 316 }, "end": { "line": 5, "column": 42, "offset": 330 } } }, { "type": "text", "value": ". It can not be set client-side.", "position": { "start": { "line": 5, "column": 42, "offset": 330 }, "end": { "line": 5, "column": 74, "offset": 362 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 5, "column": 74, "offset": 362 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When mouse lock is enabled, the player's cursor is locked to the center of\nthe screen. Moving the mouse will orbit the camera around the player's\n", "position": { "start": { "line": 7, "column": 1, "offset": 364 }, "end": { "line": 9, "column": 1, "offset": 510 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character|character" } ], "position": { "start": { "line": 9, "column": 1, "offset": 510 }, "end": { "line": 9, "column": 35, "offset": 544 } } }, { "type": "text", "value": ", and the character will face the same\ndirection as the ", "position": { "start": { "line": 9, "column": 35, "offset": 544 }, "end": { "line": 10, "column": 18, "offset": 600 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Camera|camera" } ], "position": { "start": { "line": 10, "column": 18, "offset": 600 }, "end": { "line": 10, "column": 39, "offset": 621 } } }, { "type": "text", "value": ". It also offsets the camera view\njust over the right shoulder of the player's character.", "position": { "start": { "line": 10, "column": 39, "offset": 621 }, "end": { "line": 11, "column": 56, "offset": 710 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 364 }, "end": { "line": 11, "column": 56, "offset": 710 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note that shift-lock related APIs are in the process of being deprecated,\nso it's recommended to use ", "position": { "start": { "line": 13, "column": 1, "offset": 712 }, "end": { "line": 14, "column": 28, "offset": 813 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.UserInputService.MouseBehavior" } ], "position": { "start": { "line": 14, "column": 28, "offset": 813 }, "end": { "line": 14, "column": 66, "offset": 851 } } }, { "type": "text", "value": " instead\nto lock the mouse.", "position": { "start": { "line": 14, "column": 66, "offset": 851 }, "end": { "line": 15, "column": 19, "offset": 878 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 712 }, "end": { "line": 15, "column": 19, "offset": 878 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "toggling-mouse-lock-ability", "displayName": "Toggling Mouse Lock Ability", "description": "This code sample demonstrates how to toggle whether mouse lock is available to\na player using a chat command. When a player types \"mouselock\", their ability\nto toggle mouse lock is toggled. Note that this does **not** toggle the actual\nstate of mouse lock; rather, it changes whether a player is **able** to toggle\nit themselves.\n\nThis code can be run by pasting it into a `Script` within\n`ServerScriptService`.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function toggleMouseLock(player)\n\tplayer.DevEnableMouseLock = not player.DevEnableMouseLock\n\tif player.DevEnableMouseLock then\n\t\tprint(\"Mouse lock is available\")\n\telse\n\t\tprint(\"Mouse lock is not available\")\n\tend\nend\n\nlocal function onPlayerChatted(player, message, _recipient)\n\tif message == \"mouselock\" then\n\t\ttoggleMouseLock(player)\n\tend\nend\n\nlocal function onPlayerAdded(player)\n\tplayer.Chatted:Connect(function(...)\n\t\tonPlayerChatted(player, ...)\n\tend)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "5, 7\n" } ], "type": "bool", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Camera", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.DevTouchCameraMode", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines player's camera movement mode when using a touch device.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The DevTouchCameraMode property determines the manner in which a player\nmoves their camera when using a\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 104 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.UserInputService.TouchEnabled|TouchEnabled" } ], "position": { "start": { "line": 3, "column": 1, "offset": 104 }, "end": { "line": 3, "column": 51, "offset": 154 } } }, { "type": "text", "value": " device. See\n", "position": { "start": { "line": 3, "column": 51, "offset": 154 }, "end": { "line": 4, "column": 1, "offset": 167 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Enum.DevTouchCameraMovementMode" } ], "position": { "start": { "line": 4, "column": 1, "offset": 167 }, "end": { "line": 4, "column": 34, "offset": 200 } } }, { "type": "text", "value": " for a description of each camera control\nmode available. This property cannot be set using a ", "position": { "start": { "line": 4, "column": 34, "offset": 200 }, "end": { "line": 5, "column": 53, "offset": 294 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 5, "column": 53, "offset": 294 }, "end": { "line": 5, "column": 72, "offset": 313 } } }, { "type": "text", "value": "\n(it must be set on the server using a ", "position": { "start": { "line": 5, "column": 72, "offset": 313 }, "end": { "line": 6, "column": 39, "offset": 352 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Script" } ], "position": { "start": { "line": 6, "column": 39, "offset": 352 }, "end": { "line": 6, "column": 53, "offset": 366 } } }, { "type": "text", "value": ").", "position": { "start": { "line": 6, "column": 53, "offset": 366 }, "end": { "line": 6, "column": 55, "offset": 368 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 6, "column": 55, "offset": 368 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The default value of this property is determined by\n", "position": { "start": { "line": 8, "column": 1, "offset": 370 }, "end": { "line": 9, "column": 1, "offset": 422 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.DevTouchCameraMovementMode" } ], "position": { "start": { "line": 9, "column": 1, "offset": 422 }, "end": { "line": 9, "column": 49, "offset": 470 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 9, "column": 49, "offset": 470 }, "end": { "line": 9, "column": 50, "offset": 471 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 370 }, "end": { "line": 9, "column": 50, "offset": 471 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When set to ", "position": { "start": { "line": 11, "column": 1, "offset": 473 }, "end": { "line": 11, "column": 13, "offset": 485 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "UserChoice", "position": { "start": { "line": 11, "column": 15, "offset": 487 }, "end": { "line": 11, "column": 25, "offset": 497 } } } ], "position": { "start": { "line": 11, "column": 13, "offset": 485 }, "end": { "line": 11, "column": 27, "offset": 499 } } }, { "type": "text", "value": ", a player can choose between any control mode\n(except ", "position": { "start": { "line": 11, "column": 27, "offset": 499 }, "end": { "line": 12, "column": 9, "offset": 554 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Scriptable", "position": { "start": { "line": 12, "column": 11, "offset": 556 }, "end": { "line": 12, "column": 21, "offset": 566 } } } ], "position": { "start": { "line": 12, "column": 9, "offset": 554 }, "end": { "line": 12, "column": 23, "offset": 568 } } }, { "type": "text", "value": ") in the Roblox game settings. In general, it is a\ngood idea to allow players to choose their control mode to maximize\naccessibility.", "position": { "start": { "line": 12, "column": 23, "offset": 568 }, "end": { "line": 14, "column": 15, "offset": 701 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 473 }, "end": { "line": 14, "column": 15, "offset": 701 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "It's possible to create a custom control scheme by setting this property\nto ", "position": { "start": { "line": 16, "column": 1, "offset": 703 }, "end": { "line": 17, "column": 4, "offset": 779 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Scriptable", "position": { "start": { "line": 17, "column": 6, "offset": 781 }, "end": { "line": 17, "column": 16, "offset": 791 } } } ], "position": { "start": { "line": 17, "column": 4, "offset": 779 }, "end": { "line": 17, "column": 18, "offset": 793 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 17, "column": 18, "offset": 793 }, "end": { "line": 17, "column": 19, "offset": 794 } } } ], "position": { "start": { "line": 16, "column": 1, "offset": 703 }, "end": { "line": 17, "column": 19, "offset": 794 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property doesn't affect players who aren't using a touch-enabled\ndevice. See ", "position": { "start": { "line": 19, "column": 1, "offset": 796 }, "end": { "line": 20, "column": 13, "offset": 878 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.DevComputerCameraMovementMode" } ], "position": { "start": { "line": 20, "column": 13, "offset": 878 }, "end": { "line": 20, "column": 57, "offset": 922 } } }, { "type": "text", "value": " instead.", "position": { "start": { "line": 20, "column": 57, "offset": 922 }, "end": { "line": 20, "column": 66, "offset": 931 } } } ], "position": { "start": { "line": 19, "column": 1, "offset": 796 }, "end": { "line": 20, "column": 66, "offset": 931 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "setting-a-player-s-camera-movement-mode", "displayName": "Setting a Player's Camera Movement Mode (Touch)", "description": "The example demonstrates how to set a player's camera movement mode.\n\nIn this example, we set the camera movement mode to Classic via the\n`Enum.DevTouchCameraMovementMode` enum. This means that the camera of players\non touch enabled devices will track the player but will not automatically\nrotate if the player walks left or right.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\n-- Set the player's camera movement mode on mobile devices to classic\nplayer.DevTouchCameraMovementMode = Enum.DevTouchCameraMovementMode.Classic", "expectedOutput": "", "highlightLines": "" } ], "type": "DevTouchCameraMovementMode", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Camera", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.DevTouchMovementMode", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines player's character movement mode when using a touch device.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 71, "offset": 70 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 71, "offset": 70 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The DevTouchMovementMode property determines the manner in which a player\nmoves their character when using a\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 109 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.UserInputService.TouchEnabled|TouchEnabled" } ], "position": { "start": { "line": 3, "column": 1, "offset": 109 }, "end": { "line": 3, "column": 51, "offset": 159 } } }, { "type": "text", "value": " device. See\n", "position": { "start": { "line": 3, "column": 51, "offset": 159 }, "end": { "line": 4, "column": 1, "offset": 172 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Enum.DevTouchMovementMode" } ], "position": { "start": { "line": 4, "column": 1, "offset": 172 }, "end": { "line": 4, "column": 28, "offset": 199 } } }, { "type": "text", "value": " for a description of each movement control\nmode available. This property cannot be set using a ", "position": { "start": { "line": 4, "column": 28, "offset": 199 }, "end": { "line": 5, "column": 53, "offset": 295 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 5, "column": 53, "offset": 295 }, "end": { "line": 5, "column": 72, "offset": 314 } } }, { "type": "text", "value": "\n(it must be set on the server using a ", "position": { "start": { "line": 5, "column": 72, "offset": 314 }, "end": { "line": 6, "column": 39, "offset": 353 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Script" } ], "position": { "start": { "line": 6, "column": 39, "offset": 353 }, "end": { "line": 6, "column": 53, "offset": 367 } } }, { "type": "text", "value": ").", "position": { "start": { "line": 6, "column": 53, "offset": 367 }, "end": { "line": 6, "column": 55, "offset": 369 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 6, "column": 55, "offset": 369 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The default value of this property is determined by\n", "position": { "start": { "line": 8, "column": 1, "offset": 371 }, "end": { "line": 9, "column": 1, "offset": 423 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.DevTouchMovementMode" } ], "position": { "start": { "line": 9, "column": 1, "offset": 423 }, "end": { "line": 9, "column": 43, "offset": 465 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 9, "column": 43, "offset": 465 }, "end": { "line": 9, "column": 44, "offset": 466 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 371 }, "end": { "line": 9, "column": 44, "offset": 466 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When set to ", "position": { "start": { "line": 11, "column": 1, "offset": 468 }, "end": { "line": 11, "column": 13, "offset": 480 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "UserChoice", "position": { "start": { "line": 11, "column": 15, "offset": 482 }, "end": { "line": 11, "column": 25, "offset": 492 } } } ], "position": { "start": { "line": 11, "column": 13, "offset": 480 }, "end": { "line": 11, "column": 27, "offset": 494 } } }, { "type": "text", "value": ", a player can choose between any control mode\n(except ", "position": { "start": { "line": 11, "column": 27, "offset": 494 }, "end": { "line": 12, "column": 9, "offset": 549 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Scriptable", "position": { "start": { "line": 12, "column": 11, "offset": 551 }, "end": { "line": 12, "column": 21, "offset": 561 } } } ], "position": { "start": { "line": 12, "column": 9, "offset": 549 }, "end": { "line": 12, "column": 23, "offset": 563 } } }, { "type": "text", "value": ") in the Roblox game settings. In general, it's a\ngood idea to allow players to choose their control mode to maximize\naccessibility.", "position": { "start": { "line": 12, "column": 23, "offset": 563 }, "end": { "line": 14, "column": 15, "offset": 695 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 468 }, "end": { "line": 14, "column": 15, "offset": 695 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "It's possible to create a custom control scheme by setting this property\nto ", "position": { "start": { "line": 16, "column": 1, "offset": 697 }, "end": { "line": 17, "column": 4, "offset": 773 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Scriptable", "position": { "start": { "line": 17, "column": 6, "offset": 775 }, "end": { "line": 17, "column": 16, "offset": 785 } } } ], "position": { "start": { "line": 17, "column": 4, "offset": 773 }, "end": { "line": 17, "column": 18, "offset": 787 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 17, "column": 18, "offset": 787 }, "end": { "line": 17, "column": 19, "offset": 788 } } } ], "position": { "start": { "line": 16, "column": 1, "offset": 697 }, "end": { "line": 17, "column": 19, "offset": 788 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property doesn't affect players who aren't using a touch-enabled\ndevice. See ", "position": { "start": { "line": 19, "column": 1, "offset": 790 }, "end": { "line": 20, "column": 13, "offset": 872 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.DevComputerMovementMode" } ], "position": { "start": { "line": 20, "column": 13, "offset": 872 }, "end": { "line": 20, "column": 51, "offset": 910 } } }, { "type": "text", "value": " instead.", "position": { "start": { "line": 20, "column": 51, "offset": 910 }, "end": { "line": 20, "column": 60, "offset": 919 } } } ], "position": { "start": { "line": 19, "column": 1, "offset": 790 }, "end": { "line": 20, "column": 60, "offset": 919 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "overriding-a-player-s-movement-mode", "displayName": "Setting a Player's Movement Mode (Touch)", "description": "The example demonstrates how to set the movement mode for players on touch\nenabled devices.\n\nIn this example, we set the movement mode to Thumbstick via the\n`Enum.DevTouchMovementMode` enum. This means that players on touch enabled\ndevices are able to move via a virtual thumbstick on their screen.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\ngame.Players.PlayerAdded:Connect(function(player)\n -- Set the player's movement mode on mobile devices to a dynamic thumbstick\n player.DevTouchMovementMode = Enum.DevTouchMovementMode.DynamicThumbstick\nend)", "expectedOutput": "", "highlightLines": "" } ], "type": "DevTouchMovementMode", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Control", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.DisplayName", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The DisplayName of the UserId associated with the Player.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 58, "offset": 57 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 58, "offset": 57 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "DisplayName" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 18, "offset": 17 } } }, { "type": "text", "value": " is a ", "position": { "start": { "line": 1, "column": 18, "offset": 17 }, "end": { "line": 1, "column": 24, "offset": 23 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 24, "offset": 23 }, "end": { "line": 1, "column": 38, "offset": 37 } } }, { "type": "text", "value": " property that contains the display\nname of the authenticated user associated with the ", "position": { "start": { "line": 1, "column": 38, "offset": 37 }, "end": { "line": 2, "column": 52, "offset": 124 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 2, "column": 52, "offset": 124 }, "end": { "line": 2, "column": 66, "offset": 138 } } }, { "type": "text", "value": " object.\nUnlike usernames, display names are non-unique names a player displays to\nothers. If the Roblox user has not chosen one, the property will read the\nsame as the ", "position": { "start": { "line": 2, "column": 66, "offset": 138 }, "end": { "line": 5, "column": 13, "offset": 307 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Name" } ], "position": { "start": { "line": 5, "column": 13, "offset": 307 }, "end": { "line": 5, "column": 19, "offset": 313 } } }, { "type": "text", "value": " property.", "position": { "start": { "line": 5, "column": 19, "offset": 313 }, "end": { "line": 5, "column": 29, "offset": 323 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 5, "column": 29, "offset": 323 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note:", "position": { "start": { "line": 7, "column": 1, "offset": 325 }, "end": { "line": 7, "column": 6, "offset": 330 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 325 }, "end": { "line": 7, "column": 6, "offset": 330 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Since display names are non-unique, it's possible for two players in a\nsingle instance to have identical names. If you need a globally unique\nidentifier for a player, use ", "position": { "start": { "line": 9, "column": 3, "offset": 334 }, "end": { "line": 11, "column": 32, "offset": 509 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.UserId" } ], "position": { "start": { "line": 11, "column": 32, "offset": 509 }, "end": { "line": 11, "column": 53, "offset": 530 } } }, { "type": "text", "value": " (which is static) or\n", "position": { "start": { "line": 11, "column": 53, "offset": 530 }, "end": { "line": 12, "column": 1, "offset": 552 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Name" } ], "position": { "start": { "line": 12, "column": 3, "offset": 554 }, "end": { "line": 12, "column": 22, "offset": 573 } } }, { "type": "text", "value": " (which is the current Username) instead.", "position": { "start": { "line": 12, "column": 22, "offset": 573 }, "end": { "line": 12, "column": 63, "offset": 614 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 332 }, "end": { "line": 12, "column": 63, "offset": 614 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Characters generated with ", "position": { "start": { "line": 13, "column": 3, "offset": 617 }, "end": { "line": 13, "column": 29, "offset": 643 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.LoadCharacter" } ], "position": { "start": { "line": 13, "column": 29, "offset": 643 }, "end": { "line": 13, "column": 57, "offset": 671 } } }, { "type": "text", "value": " or by the Roblox\nengine will have their ", "position": { "start": { "line": 13, "column": 57, "offset": 671 }, "end": { "line": 14, "column": 26, "offset": 714 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Humanoid.DisplayName" } ], "position": { "start": { "line": 14, "column": 26, "offset": 714 }, "end": { "line": 14, "column": 54, "offset": 742 } } }, { "type": "text", "value": " property assigned to\nthe ", "position": { "start": { "line": 14, "column": 54, "offset": 742 }, "end": { "line": 15, "column": 7, "offset": 770 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.DisplayName" } ], "position": { "start": { "line": 15, "column": 7, "offset": 770 }, "end": { "line": 15, "column": 33, "offset": 796 } } }, { "type": "text", "value": " property.", "position": { "start": { "line": 15, "column": 33, "offset": 796 }, "end": { "line": 15, "column": 43, "offset": 806 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 615 }, "end": { "line": 15, "column": 43, "offset": 806 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Display names may have unicode characters in the string. See\n", "position": { "start": { "line": 16, "column": 3, "offset": 809 }, "end": { "line": 17, "column": 1, "offset": 870 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Library.utf8|UTF-8" } ], "position": { "start": { "line": 17, "column": 3, "offset": 872 }, "end": { "line": 17, "column": 23, "offset": 892 } } }, { "type": "text", "value": " for more information on how to work with strings\nwith unicode characters.", "position": { "start": { "line": 17, "column": 23, "offset": 892 }, "end": { "line": 18, "column": 27, "offset": 968 } } } ], "position": { "start": { "line": 16, "column": 1, "offset": 807 }, "end": { "line": 18, "column": 27, "offset": 968 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 9, "column": 1, "offset": 332 }, "end": { "line": 18, "column": 27, "offset": 968 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "type": "string", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Player.FollowUserId", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Describes the user ID of the player who was followed into a game by a\nplayer.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 8, "offset": 77 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 8, "offset": 77 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The FollowUserId is a ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 23, "offset": 22 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 23, "offset": 22 }, "end": { "line": 1, "column": 37, "offset": 36 } } }, { "type": "text", "value": " property that contains the\n", "position": { "start": { "line": 1, "column": 37, "offset": 36 }, "end": { "line": 2, "column": 1, "offset": 64 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.UserId" } ], "position": { "start": { "line": 2, "column": 1, "offset": 64 }, "end": { "line": 2, "column": 22, "offset": 85 } } }, { "type": "text", "value": " of the user that a player followed into the game. If\nthe player did not follow anyone into the game, this property will be 0.\nThis property is useful for alerting players who have been followed by\nanother player into the game.", "position": { "start": { "line": 2, "column": 22, "offset": 85 }, "end": { "line": 5, "column": 30, "offset": 312 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 5, "column": 30, "offset": 312 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "You can get the name of the player followed using this user ID and the\n", "position": { "start": { "line": 7, "column": 1, "offset": 314 }, "end": { "line": 8, "column": 1, "offset": 385 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players:GetNameFromUserIdAsync()" } ], "position": { "start": { "line": 8, "column": 1, "offset": 385 }, "end": { "line": 8, "column": 41, "offset": 425 } } }, { "type": "text", "value": " function.", "position": { "start": { "line": 8, "column": 41, "offset": 425 }, "end": { "line": 8, "column": 51, "offset": 435 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 314 }, "end": { "line": 8, "column": 51, "offset": 435 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Followed-Alert", "displayName": "Followed Alert", "description": "This code sample alerts players if a new player follows the local player into\nthe game. It does so using a `Hint`. Place this in a `LocalScript` in\n`StarterPlayerScripts`.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nlocal function onPlayerAdded(newPlayer)\n\tif newPlayer.FollowUserId == player.UserId then\n\t\tlocal hint = Instance.new(\"Hint\")\n\t\thint.Parent = player:WaitForChild(\"PlayerGui\")\n\t\thint.Text = \"You were followed to this game by \" .. newPlayer.Name .. \"!\"\n\t\ttask.delay(3, function()\n\t\t\tif hint then\n\t\t\t\thint:Destroy()\n\t\t\tend\n\t\tend)\n\tend\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "type": "int64", "tags": [ "READ_ONLY", "NOT_REPLICATED" ], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.GameplayPaused", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Whether player client-side gameplay is currently paused.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 57, "offset": 56 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 57, "offset": 56 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "GameplayPaused", "position": { "start": { "line": 1, "column": 7, "offset": 6 }, "end": { "line": 1, "column": 21, "offset": 20 } } } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 23, "offset": 22 } } }, { "type": "text", "value": " property indicates if the player is currently in a\npause state in a place with\n", "position": { "start": { "line": 1, "column": 23, "offset": 22 }, "end": { "line": 3, "column": 1, "offset": 102 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Workspace.StreamingEnabled|StreamingEnabled" } ], "position": { "start": { "line": 3, "column": 1, "offset": 102 }, "end": { "line": 3, "column": 52, "offset": 153 } } }, { "type": "text", "value": " activated. It is set\non the client but replicated to the server. To determine the pause status,\nyou can utilize this property.", "position": { "start": { "line": 3, "column": 52, "offset": 153 }, "end": { "line": 5, "column": 31, "offset": 280 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 5, "column": 31, "offset": 280 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also:", "position": { "start": { "line": 7, "column": 1, "offset": 282 }, "end": { "line": 7, "column": 10, "offset": 291 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 282 }, "end": { "line": 7, "column": 10, "offset": 291 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Workspace.StreamingEnabled" } ], "position": { "start": { "line": 9, "column": 3, "offset": 295 }, "end": { "line": 9, "column": 37, "offset": 329 } } }, { "type": "text", "value": " which controls whether content\nstreaming is enabled", "position": { "start": { "line": 9, "column": 37, "offset": 329 }, "end": { "line": 10, "column": 23, "offset": 383 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 293 }, "end": { "line": 10, "column": 23, "offset": 383 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Workspace.StreamingIntegrityMode" } ], "position": { "start": { "line": 11, "column": 3, "offset": 386 }, "end": { "line": 11, "column": 43, "offset": 426 } } }, { "type": "text", "value": " and\n", "position": { "start": { "line": 11, "column": 43, "offset": 426 }, "end": { "line": 12, "column": 1, "offset": 431 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Enum.StreamingIntegrityMode" } ], "position": { "start": { "line": 12, "column": 3, "offset": 433 }, "end": { "line": 12, "column": 32, "offset": 462 } } }, { "type": "text", "value": " for more details on when gameplay is\npaused.", "position": { "start": { "line": 12, "column": 32, "offset": 462 }, "end": { "line": 13, "column": 10, "offset": 509 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 384 }, "end": { "line": 13, "column": 10, "offset": 509 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 9, "column": 1, "offset": 293 }, "end": { "line": 13, "column": 10, "offset": 509 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "type": "bool", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NOT_ACCESSIBLE_SECURITY" }, "threadSafety": "READ_SAFE", "category": "Behavior", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.HasVerifiedBadge", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Indicates if a player has a Verified Badge.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The HasVerifiedBadge ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 22, "offset": 21 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 22, "offset": 21 }, "end": { "line": 1, "column": 36, "offset": 35 } } }, { "type": "text", "value": " property indicates if the player has a\nVerified Badge.", "position": { "start": { "line": 1, "column": 36, "offset": 35 }, "end": { "line": 2, "column": 16, "offset": 90 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 16, "offset": 90 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [], "type": "bool", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Player.HealthDisplayDistance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Sets the distance at which this player will see other Humanoid's health\nbars. If set to 0, the health bars will not be displayed.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 58, "offset": 129 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 58, "offset": 129 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The HealthDisplayDistance ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 27, "offset": 26 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 27, "offset": 26 }, "end": { "line": 1, "column": 41, "offset": 40 } } }, { "type": "text", "value": " property sets the distance in\nstuds at which this player will see other ", "position": { "start": { "line": 1, "column": 41, "offset": 40 }, "end": { "line": 2, "column": 43, "offset": 113 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Humanoid" } ], "position": { "start": { "line": 2, "column": 43, "offset": 113 }, "end": { "line": 2, "column": 59, "offset": 129 } } }, { "type": "text", "value": "'s health bars.\nIf set to 0, the health bars will not be displayed. This property is set\nto ", "position": { "start": { "line": 2, "column": 59, "offset": 129 }, "end": { "line": 4, "column": 4, "offset": 221 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.HealthDisplayDistance" } ], "position": { "start": { "line": 4, "column": 4, "offset": 221 }, "end": { "line": 4, "column": 47, "offset": 264 } } }, { "type": "text", "value": " by default.", "position": { "start": { "line": 4, "column": 47, "offset": 264 }, "end": { "line": 4, "column": 59, "offset": 276 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 59, "offset": 276 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If a Humanoid's health bar is visible, you can set the display type using\n", "position": { "start": { "line": 6, "column": 1, "offset": 278 }, "end": { "line": 7, "column": 1, "offset": 352 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Humanoid.DisplayDistanceType" } ], "position": { "start": { "line": 7, "column": 1, "offset": 352 }, "end": { "line": 7, "column": 37, "offset": 388 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 7, "column": 37, "offset": 388 }, "end": { "line": 7, "column": 38, "offset": 389 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 278 }, "end": { "line": 7, "column": 38, "offset": 389 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "hiding-player-health-and-names", "displayName": "Hiding Player Health and Names", "description": "This example demonstrates how to hide other `Humanoid`'s (`Player` and NPC)\nhealth bars and names.\n\nThis is done by setting the player's `Class.Player.HealthDisplayDistance` and\n`Class.Player.NameDisplayDistance` properties to 0.\n\nIf you would like to display health bars and names, you set the properties to\na value greater than 0. For instance, setting the properties to 100 means that\nthe player will see other player's health and names up to 100 studs away.\n\nTo modify the default values for players, you can change the values of the\n`StarterClass.Player.HealthDisplayDistance` and\n`StarterClass.Player.NameDisplayDistance` properties.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nplayer.HealthDisplayDistance = 0\nplayer.NameDisplayDistance = 0", "expectedOutput": "", "highlightLines": "" } ], "type": "float", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Camera", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.LocaleId", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property shows the locale id that the local player has set for their\nRoblox account.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 16, "offset": 89 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 16, "offset": 89 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The LocaleId ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 14, "offset": 13 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 14, "offset": 13 }, "end": { "line": 1, "column": 28, "offset": 27 } } }, { "type": "text", "value": " property shows the locale id that the local\nplayer has set for their Roblox account. It holds a string with the two\nletter code (for example, \"en-us\") for the locale.", "position": { "start": { "line": 1, "column": 28, "offset": 27 }, "end": { "line": 3, "column": 51, "offset": 194 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 51, "offset": 194 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This can be used to determine the geographic demographic of your game's\nplayer base.", "position": { "start": { "line": 5, "column": 1, "offset": 196 }, "end": { "line": 6, "column": 13, "offset": 280 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 196 }, "end": { "line": 6, "column": 13, "offset": 280 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property allows access to the player's locale from the server. It is\nsimilar to ", "position": { "start": { "line": 8, "column": 1, "offset": 282 }, "end": { "line": 9, "column": 12, "offset": 367 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalizationService" } ], "position": { "start": { "line": 9, "column": 12, "offset": 367 }, "end": { "line": 9, "column": 39, "offset": 394 } } }, { "type": "text", "value": "'s\n", "position": { "start": { "line": 9, "column": 39, "offset": 394 }, "end": { "line": 10, "column": 1, "offset": 397 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalizationService.RobloxLocaleId" } ], "position": { "start": { "line": 10, "column": 1, "offset": 397 }, "end": { "line": 10, "column": 43, "offset": 439 } } }, { "type": "text", "value": " property.", "position": { "start": { "line": 10, "column": 43, "offset": 439 }, "end": { "line": 10, "column": 53, "offset": 449 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 282 }, "end": { "line": 10, "column": 53, "offset": 449 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "checking-a-player-s-locale", "displayName": "Checking a Player's Locale", "description": "This example demonstrates how to check the locale of a local player using the\n`Class.Player.LocaleId` property. It prints a string with the two letter\nlocale code for the locale of the local player.\n\nFor instance, if the player's local is within the US, the locale will be:\n\n> en-us\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nprint(player.LocaleId)", "expectedOutput": "", "highlightLines": "" } ], "type": "string", "tags": [ "HIDDEN", "READ_ONLY", "NOT_REPLICATED" ], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Player.MembershipType", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Describes the account's membership type.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 41, "offset": 40 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 41, "offset": 40 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The MembershipType ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 20, "offset": 19 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 20, "offset": 19 }, "end": { "line": 1, "column": 34, "offset": 33 } } }, { "type": "text", "value": " property can be used to determine the\nmembership type of the player. It holds a ", "position": { "start": { "line": 1, "column": 34, "offset": 33 }, "end": { "line": 2, "column": 43, "offset": 114 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Enum.MembershipType" } ], "position": { "start": { "line": 2, "column": 43, "offset": 114 }, "end": { "line": 2, "column": 64, "offset": 135 } } }, { "type": "text", "value": " enum of\nthe account's membership type.", "position": { "start": { "line": 2, "column": 64, "offset": 135 }, "end": { "line": 3, "column": 31, "offset": 174 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 31, "offset": 174 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property can only be read from to determine membership (it cannot be\nset to another membership type). The property can only be changed via\n", "position": { "start": { "line": 5, "column": 1, "offset": 176 }, "end": { "line": 7, "column": 1, "offset": 320 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.CoreScript" } ], "position": { "start": { "line": 7, "column": 1, "offset": 320 }, "end": { "line": 7, "column": 19, "offset": 338 } } }, { "type": "text", "value": "s using ", "position": { "start": { "line": 7, "column": 19, "offset": 338 }, "end": { "line": 7, "column": 27, "offset": 346 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:SetMembershipType()" } ], "position": { "start": { "line": 7, "column": 27, "offset": 346 }, "end": { "line": 7, "column": 61, "offset": 380 } } }, { "type": "text", "value": " - which are\nnot accessible.", "position": { "start": { "line": 7, "column": 61, "offset": 380 }, "end": { "line": 8, "column": 16, "offset": 408 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 176 }, "end": { "line": 8, "column": 16, "offset": 408 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "check-membership-status", "displayName": "Check Player Membership Status", "description": "The following example checks whether a player has [Premium](https://www.roblox.com/premium/membership) membership.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nif player.MembershipType == Enum.MembershipType.Premium then\n\t-- Take some action specifically for Premium members\nend", "expectedOutput": "", "highlightLines": "4\n" } ], "type": "MembershipType", "tags": [ "READ_ONLY", "NOT_REPLICATED" ], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Player.NameDisplayDistance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Sets the distance at which this player will see other Humanoid's names. If\nset to 0, names are hidden.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 28, "offset": 102 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 28, "offset": 102 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The NameDisplayDistance ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 25, "offset": 24 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer" } ], "position": { "start": { "line": 1, "column": 25, "offset": 24 }, "end": { "line": 1, "column": 46, "offset": 45 } } }, { "type": "text", "value": " property sets the distance\nin studs at which this player will see other ", "position": { "start": { "line": 1, "column": 46, "offset": 45 }, "end": { "line": 2, "column": 46, "offset": 118 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Humanoid" } ], "position": { "start": { "line": 2, "column": 46, "offset": 118 }, "end": { "line": 2, "column": 62, "offset": 134 } } }, { "type": "text", "value": "'s names. If\nthe property is set to 0, names are hidden. This property is set to\n", "position": { "start": { "line": 2, "column": 62, "offset": 134 }, "end": { "line": 4, "column": 1, "offset": 215 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterPlayer.NameDisplayDistance" } ], "position": { "start": { "line": 4, "column": 1, "offset": 215 }, "end": { "line": 4, "column": 42, "offset": 256 } } }, { "type": "text", "value": " by default.", "position": { "start": { "line": 4, "column": 42, "offset": 256 }, "end": { "line": 4, "column": 54, "offset": 268 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 54, "offset": 268 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If a Humanoid's health bar is visible, you can set the display type using\n", "position": { "start": { "line": 6, "column": 1, "offset": 270 }, "end": { "line": 7, "column": 1, "offset": 344 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Humanoid.DisplayDistanceType" } ], "position": { "start": { "line": 7, "column": 1, "offset": 344 }, "end": { "line": 7, "column": 37, "offset": 380 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 7, "column": 37, "offset": 380 }, "end": { "line": 7, "column": 38, "offset": 381 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 270 }, "end": { "line": 7, "column": 38, "offset": 381 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "hiding-player-health-and-names", "displayName": "Hiding Player Health and Names", "description": "This example demonstrates how to hide other `Humanoid`'s (`Player` and NPC)\nhealth bars and names.\n\nThis is done by setting the player's `Class.Player.HealthDisplayDistance` and\n`Class.Player.NameDisplayDistance` properties to 0.\n\nIf you would like to display health bars and names, you set the properties to\na value greater than 0. For instance, setting the properties to 100 means that\nthe player will see other player's health and names up to 100 studs away.\n\nTo modify the default values for players, you can change the values of the\n`StarterClass.Player.HealthDisplayDistance` and\n`StarterClass.Player.NameDisplayDistance` properties.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nplayer.HealthDisplayDistance = 0\nplayer.NameDisplayDistance = 0", "expectedOutput": "", "highlightLines": "" } ], "type": "float", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Camera", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.Neutral", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines whether the player is on a specific team.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 53, "offset": 52 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 53, "offset": 52 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The Neutral property determines whether the player is on a specific team.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 74, "offset": 73 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 74, "offset": 73 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "When ", "position": { "start": { "line": 3, "column": 3, "offset": 77 }, "end": { "line": 3, "column": 8, "offset": 82 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "true", "position": { "start": { "line": 3, "column": 9, "offset": 83 }, "end": { "line": 3, "column": 13, "offset": 87 } } } ], "position": { "start": { "line": 3, "column": 8, "offset": 82 }, "end": { "line": 3, "column": 14, "offset": 88 } } }, { "type": "text", "value": ", the player is not on a specific team. This also means that\nthe ", "position": { "start": { "line": 3, "column": 14, "offset": 88 }, "end": { "line": 4, "column": 7, "offset": 155 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Team" } ], "position": { "start": { "line": 4, "column": 7, "offset": 155 }, "end": { "line": 4, "column": 26, "offset": 174 } } }, { "type": "text", "value": " property will be nil and the\n", "position": { "start": { "line": 4, "column": 26, "offset": 174 }, "end": { "line": 5, "column": 1, "offset": 204 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.TeamColor" } ], "position": { "start": { "line": 5, "column": 3, "offset": 206 }, "end": { "line": 5, "column": 27, "offset": 230 } } }, { "type": "text", "value": " will be white.", "position": { "start": { "line": 5, "column": 27, "offset": 230 }, "end": { "line": 5, "column": 42, "offset": 245 } } } ], "position": { "start": { "line": 3, "column": 1, "offset": 75 }, "end": { "line": 5, "column": 42, "offset": 245 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "When ", "position": { "start": { "line": 6, "column": 3, "offset": 248 }, "end": { "line": 6, "column": 8, "offset": 253 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "false", "position": { "start": { "line": 6, "column": 9, "offset": 254 }, "end": { "line": 6, "column": 14, "offset": 259 } } } ], "position": { "start": { "line": 6, "column": 8, "offset": 253 }, "end": { "line": 6, "column": 15, "offset": 260 } } }, { "type": "text", "value": ", the player is on a specific team. The ", "position": { "start": { "line": 6, "column": 15, "offset": 260 }, "end": { "line": 6, "column": 55, "offset": 300 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Team" } ], "position": { "start": { "line": 6, "column": 55, "offset": 300 }, "end": { "line": 6, "column": 74, "offset": 319 } } }, { "type": "text", "value": "\nproperty will correspond to the ", "position": { "start": { "line": 6, "column": 74, "offset": 319 }, "end": { "line": 7, "column": 35, "offset": 354 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Team" } ], "position": { "start": { "line": 7, "column": 35, "offset": 354 }, "end": { "line": 7, "column": 47, "offset": 366 } } }, { "type": "text", "value": " that the player is on, as\nwill the ", "position": { "start": { "line": 7, "column": 47, "offset": 366 }, "end": { "line": 8, "column": 12, "offset": 404 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.TeamColor" } ], "position": { "start": { "line": 8, "column": 12, "offset": 404 }, "end": { "line": 8, "column": 36, "offset": 428 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 8, "column": 36, "offset": 428 }, "end": { "line": 8, "column": 37, "offset": 429 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 246 }, "end": { "line": 8, "column": 37, "offset": 429 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 3, "column": 1, "offset": 75 }, "end": { "line": 8, "column": 37, "offset": 429 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "checking-if-a-player-is-neutral", "displayName": "Checking if a Player is Neutral", "description": "This example checks if a player is neutral. If the player is neutral, the game\nprints:\n\n> Player is neutral!\n\nIf the player is neutral, the game prints:\n\n> Player is not neutral!\n\n_Note:_ Although this example prints the value of the local player's neutral\nproperty, you can change the example to get the value for any player.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nif player.Neutral then\n\tprint(\"Player is neutral!\")\nelse\n\tprint(\"Player is not neutral!\")\nend", "expectedOutput": "", "highlightLines": "" } ], "type": "bool", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Team", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.ReplicationFocus", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Sets the part to focus replication around.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 43, "offset": 42 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 43, "offset": 42 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ReplicationFocus ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 22, "offset": 21 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 22, "offset": 21 }, "end": { "line": 1, "column": 36, "offset": 35 } } }, { "type": "text", "value": " property sets the part to focus\nreplication around a Player. Different Roblox systems that communicate\nover the network (such as physics, streaming, etc) replicate at different\nrates depending on how close objects are to the replication focus.", "position": { "start": { "line": 1, "column": 36, "offset": 35 }, "end": { "line": 4, "column": 67, "offset": 279 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 67, "offset": 279 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When this property is nil, it reverts to its default behavior which is to\ntreat the local player's character's ", "position": { "start": { "line": 6, "column": 1, "offset": 281 }, "end": { "line": 7, "column": 38, "offset": 392 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Model.PrimaryPart|PrimaryPart" } ], "position": { "start": { "line": 7, "column": 38, "offset": 392 }, "end": { "line": 7, "column": 75, "offset": 429 } } }, { "type": "text", "value": "\nas the replication focus.", "position": { "start": { "line": 7, "column": 75, "offset": 429 }, "end": { "line": 8, "column": 26, "offset": 455 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 281 }, "end": { "line": 8, "column": 26, "offset": 455 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property should only be set on the server with a ", "position": { "start": { "line": 10, "column": 1, "offset": 457 }, "end": { "line": 10, "column": 55, "offset": 511 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Script" } ], "position": { "start": { "line": 10, "column": 55, "offset": 511 }, "end": { "line": 10, "column": 69, "offset": 525 } } }, { "type": "text", "value": ", not\na ", "position": { "start": { "line": 10, "column": 69, "offset": 525 }, "end": { "line": 11, "column": 3, "offset": 533 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 11, "column": 3, "offset": 533 }, "end": { "line": 11, "column": 22, "offset": 552 } } }, { "type": "text", "value": ". Note that this property does not change or update\nnetwork ownership of parts.", "position": { "start": { "line": 11, "column": 22, "offset": 552 }, "end": { "line": 12, "column": 28, "offset": 631 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 457 }, "end": { "line": 12, "column": 28, "offset": 631 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "setting-a-player-s-replication-focus", "displayName": "Setting a Player's Replication Focus", "description": "This example creates a new `BasePart` and sets the `Player`'s\n`Class.Player.ReplicationFocus` to that part.\n\nThis demonstrates the functionality of the ReplicationFocus property. You can\neasily change the part that the focus is set to to change the replication\nfocus.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal PLAYER_NAME = \"polarpanda16\"\n\nlocal player = Players:WaitForChild(PLAYER_NAME)\n\nlocal part = Instance.new(\"Part\")\npart.Parent = workspace\npart.Name = \"ReplicationFocusPart\"\npart.Anchored = true\nplayer.ReplicationFocus = part", "expectedOutput": "", "highlightLines": "" } ], "type": "Instance", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.RespawnLocation", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If set, the player will respawn at the given ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 46, "offset": 45 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.SpawnLocation" } ], "position": { "start": { "line": 1, "column": 46, "offset": 45 }, "end": { "line": 1, "column": 67, "offset": 66 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 67, "offset": 66 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If set, the player will respawn at the given ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 46, "offset": 45 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.SpawnLocation" } ], "position": { "start": { "line": 1, "column": 46, "offset": 45 }, "end": { "line": 1, "column": 67, "offset": 66 } } }, { "type": "text", "value": ". This\nproperty can only be set through Lua and must contain a reference to a\nvalid ", "position": { "start": { "line": 1, "column": 67, "offset": 66 }, "end": { "line": 3, "column": 7, "offset": 150 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.SpawnLocation" } ], "position": { "start": { "line": 3, "column": 7, "offset": 150 }, "end": { "line": 3, "column": 28, "offset": 171 } } }, { "type": "text", "value": ", which must meet the following criteria:", "position": { "start": { "line": 3, "column": 28, "offset": 171 }, "end": { "line": 3, "column": 69, "offset": 212 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 69, "offset": 212 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Descendant of ", "position": { "start": { "line": 5, "column": 3, "offset": 216 }, "end": { "line": 5, "column": 17, "offset": 230 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Workspace" } ], "position": { "start": { "line": 5, "column": 17, "offset": 230 }, "end": { "line": 5, "column": 34, "offset": 247 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 214 }, "end": { "line": 5, "column": 34, "offset": 247 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.SpawnLocation.TeamColor" } ], "position": { "start": { "line": 6, "column": 3, "offset": 250 }, "end": { "line": 6, "column": 34, "offset": 281 } } }, { "type": "text", "value": " is set to the ", "position": { "start": { "line": 6, "column": 34, "offset": 281 }, "end": { "line": 6, "column": 49, "offset": 296 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.TeamColor" } ], "position": { "start": { "line": 6, "column": 49, "offset": 296 }, "end": { "line": 6, "column": 73, "offset": 320 } } }, { "type": "text", "value": "\nor ", "position": { "start": { "line": 6, "column": 73, "offset": 320 }, "end": { "line": 7, "column": 6, "offset": 326 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.SpawnLocation.Neutral" } ], "position": { "start": { "line": 7, "column": 6, "offset": 326 }, "end": { "line": 7, "column": 35, "offset": 355 } } }, { "type": "text", "value": " is set to true", "position": { "start": { "line": 7, "column": 35, "offset": 355 }, "end": { "line": 7, "column": 50, "offset": 370 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 248 }, "end": { "line": 7, "column": 50, "offset": 370 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 5, "column": 1, "offset": 214 }, "end": { "line": 7, "column": 50, "offset": 370 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If RespawnLocation is not set to a valid ", "position": { "start": { "line": 9, "column": 1, "offset": 372 }, "end": { "line": 9, "column": 42, "offset": 413 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.SpawnLocation" } ], "position": { "start": { "line": 9, "column": 42, "offset": 413 }, "end": { "line": 9, "column": 63, "offset": 434 } } }, { "type": "text", "value": " then the\ndefault spawning logic will apply. For more information on this see the\npage for ", "position": { "start": { "line": 9, "column": 63, "offset": 434 }, "end": { "line": 11, "column": 10, "offset": 525 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.SpawnLocation" } ], "position": { "start": { "line": 11, "column": 10, "offset": 525 }, "end": { "line": 11, "column": 31, "offset": 546 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 11, "column": 31, "offset": 546 }, "end": { "line": 11, "column": 32, "offset": 547 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 372 }, "end": { "line": 11, "column": 32, "offset": 547 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h5", "properties": {}, "children": [ { "type": "text", "value": "Alternatives to RespawnLocation", "position": { "start": { "line": 13, "column": 7, "offset": 555 }, "end": { "line": 13, "column": 38, "offset": 586 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 549 }, "end": { "line": 13, "column": 38, "offset": 586 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "A ", "position": { "start": { "line": 15, "column": 3, "offset": 590 }, "end": { "line": 15, "column": 5, "offset": 592 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 15, "column": 5, "offset": 592 }, "end": { "line": 15, "column": 19, "offset": 606 } } }, { "type": "text", "value": " will spawn from ", "position": { "start": { "line": 15, "column": 19, "offset": 606 }, "end": { "line": 15, "column": 36, "offset": 623 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.SpawnLocation|SpawnLocations" } ], "position": { "start": { "line": 15, "column": 36, "offset": 623 }, "end": { "line": 15, "column": 72, "offset": 659 } } }, { "type": "text", "value": "\nbelonging to their team. In some cases it may be simpler to change the\nplayer's ", "position": { "start": { "line": 15, "column": 72, "offset": 659 }, "end": { "line": 17, "column": 12, "offset": 744 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Team" } ], "position": { "start": { "line": 17, "column": 12, "offset": 744 }, "end": { "line": 17, "column": 31, "offset": 763 } } }, { "type": "text", "value": " instead.", "position": { "start": { "line": 17, "column": 31, "offset": 763 }, "end": { "line": 17, "column": 40, "offset": 772 } } } ], "position": { "start": { "line": 15, "column": 1, "offset": 588 }, "end": { "line": 17, "column": 40, "offset": 772 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Implement your own custom spawn logic using ", "position": { "start": { "line": 18, "column": 3, "offset": 775 }, "end": { "line": 18, "column": 47, "offset": 819 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.PVInstance:PivotTo()" } ], "position": { "start": { "line": 18, "column": 47, "offset": 819 }, "end": { "line": 18, "column": 75, "offset": 847 } } }, { "type": "text", "value": "\nto manually move the ", "position": { "start": { "line": 18, "column": 75, "offset": 847 }, "end": { "line": 19, "column": 24, "offset": 871 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 19, "column": 24, "offset": 871 }, "end": { "line": 19, "column": 48, "offset": 895 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 19, "column": 48, "offset": 895 }, "end": { "line": 19, "column": 49, "offset": 896 } } } ], "position": { "start": { "line": 18, "column": 1, "offset": 773 }, "end": { "line": 19, "column": 49, "offset": 896 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 15, "column": 1, "offset": 588 }, "end": { "line": 19, "column": 49, "offset": 896 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "change-spawn-on-touch", "displayName": "Change Spawn on Touch", "description": "This code sample will set the player to always respawn from the last\nSpawnLocation they touched. New players will respawn from the SpawnLocation\nnamed 'FirstSpawn' until they touch a different SpawnLocation.\n\nThis is an alternative to using the AllowTeamChangeOnTouch property to switch\nSpawnLocations and does not require Teams.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function addSpawn(spawnLocation)\n\t-- listen for the spawn being touched\n\tspawnLocation.Touched:Connect(function(hit)\n\t\tlocal character = hit:FindFirstAncestorOfClass(\"Model\")\n\t\tif character then\n\t\t\tlocal player = Players:GetPlayerFromCharacter(character)\n\t\t\tif player and player.RespawnLocation ~= spawnLocation then\n\t\t\t\tlocal humanoid = character:FindFirstChildOfClass(\"Humanoid\")\n\t\t\t\t-- make sure the character isn't dead\n\t\t\t\tif humanoid and humanoid:GetState() ~= Enum.HumanoidStateType.Dead then\n\t\t\t\t\tprint(\"spawn set\")\n\t\t\t\t\tplayer.RespawnLocation = spawnLocation\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend)\nend\n\nlocal firstSpawn\n\n-- look through the workspace for spawns\nfor _, descendant in pairs(workspace:GetDescendants()) do\n\tif descendant:IsA(\"SpawnLocation\") then\n\t\tif descendant.Name == \"FirstSpawn\" then\n\t\t\tfirstSpawn = descendant\n\t\tend\n\t\taddSpawn(descendant)\n\tend\nend\n\nlocal function playerAdded(player)\n\tplayer.RespawnLocation = firstSpawn\nend\n\n-- listen for new players\nPlayers.PlayerAdded:Connect(playerAdded)\n\n-- go through existing players\nfor _, player in pairs(Players:GetPlayers()) do\n\tplayerAdded(player)\nend", "expectedOutput": "", "highlightLines": "" } ], "type": "SpawnLocation", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.Team", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines the Team with which a Player is associated.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 55, "offset": 54 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 55, "offset": 54 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The Team property is a reference to a ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 39, "offset": 38 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Team" } ], "position": { "start": { "line": 1, "column": 39, "offset": 38 }, "end": { "line": 1, "column": 51, "offset": 50 } } }, { "type": "text", "value": " object within the\n", "position": { "start": { "line": 1, "column": 51, "offset": 50 }, "end": { "line": 2, "column": 1, "offset": 69 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Teams" } ], "position": { "start": { "line": 2, "column": 1, "offset": 69 }, "end": { "line": 2, "column": 14, "offset": 82 } } }, { "type": "text", "value": " service. It determines the team the player is on; if the\n", "position": { "start": { "line": 2, "column": 14, "offset": 82 }, "end": { "line": 3, "column": 1, "offset": 140 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 3, "column": 1, "offset": 140 }, "end": { "line": 3, "column": 15, "offset": 154 } } }, { "type": "text", "value": " isn't on a team or has an invalid ", "position": { "start": { "line": 3, "column": 15, "offset": 154 }, "end": { "line": 3, "column": 50, "offset": 189 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.TeamColor" } ], "position": { "start": { "line": 3, "column": 50, "offset": 189 }, "end": { "line": 3, "column": 74, "offset": 213 } } }, { "type": "text", "value": ",\nthis property is nil. When this property is set, the player has joined the\n", "position": { "start": { "line": 3, "column": 74, "offset": 213 }, "end": { "line": 5, "column": 1, "offset": 290 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Team" } ], "position": { "start": { "line": 5, "column": 1, "offset": 290 }, "end": { "line": 5, "column": 13, "offset": 302 } } }, { "type": "text", "value": " and the ", "position": { "start": { "line": 5, "column": 13, "offset": 302 }, "end": { "line": 5, "column": 22, "offset": 311 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Team.PlayerAdded" } ], "position": { "start": { "line": 5, "column": 22, "offset": 311 }, "end": { "line": 5, "column": 46, "offset": 335 } } }, { "type": "text", "value": " event fires on the\nassociated team. Similarly, ", "position": { "start": { "line": 5, "column": 46, "offset": 335 }, "end": { "line": 6, "column": 29, "offset": 383 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Team.PlayerRemoved" } ], "position": { "start": { "line": 6, "column": 29, "offset": 383 }, "end": { "line": 6, "column": 55, "offset": 409 } } }, { "type": "text", "value": " fires when the\nproperty is unset from a certain ", "position": { "start": { "line": 6, "column": 55, "offset": 409 }, "end": { "line": 7, "column": 34, "offset": 458 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Team" } ], "position": { "start": { "line": 7, "column": 34, "offset": 458 }, "end": { "line": 7, "column": 46, "offset": 470 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 7, "column": 46, "offset": 470 }, "end": { "line": 7, "column": 47, "offset": 471 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 7, "column": 47, "offset": 471 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Playing-Spectating-Teams", "displayName": "Playing/Spectating Teams", "description": "This code sample, although lengthy, is quite simple: detect when a player\nchats /play, then put them on the \"Playing\" team. When they die, move them\nback to the \"Spectating\" team.\n", "codeSample": "local Players = game:GetService(\"Players\")\nlocal Teams = game:GetService(\"Teams\")\n\nlocal teamPlaying = Teams.Playing\nlocal teamSpectators = Teams.Spectating\n\nlocal playCommand = \"/play\"\n\nlocal function play(player)\n\tplayer.Team = teamPlaying\n\tplayer.TeamColor = teamPlaying.TeamColor\n\t-- Respawn the player (moves them to spawn location)\n\tplayer:LoadCharacter()\nend\n\nlocal function onPlayerDied(player, _character)\n\t-- When someone dies, put them on the spectator team\n\tplayer.Team = teamSpectators\nend\n\nlocal function onPlayerSpawned(player, character)\n\tlocal human = character:WaitForChild(\"Humanoid\")\n\thuman.Died:Connect(function()\n\t\tonPlayerDied(player, character)\n\tend)\nend\n\nlocal function onPlayerChatted(player, message)\n\tif message:sub(1, playCommand:len()):lower() == playCommand then\n\t\tplay(player)\n\tend\nend\n\nlocal function onPlayerAdded(player)\n\tif player.Character then\n\t\tonPlayerSpawned(player, player.Character)\n\tend\n\tplayer.CharacterAdded:Connect(function()\n\t\tonPlayerSpawned(player, player.Character)\n\tend)\n\tplayer.Chatted:Connect(function(message, _recipient)\n\t\tonPlayerChatted(player, message)\n\tend)\nend\n\nfor _, player in pairs(Players:GetPlayers()) do\n\tonPlayerAdded(player)\nend\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" }, { "identifier": "Join-Team-Command", "displayName": "Join Team Command", "description": "This code sample allows any player to chat \"/jointeam \" where is\nthe name of a team. It uses string manipulation using string.sub and\nstring.lower to make the command case-insensitive and allow for partial\nmatches. For example, \"/jointeam red\" will match the team \"Red Robins\".\n", "codeSample": "local Players = game:GetService(\"Players\")\nlocal Teams = game:GetService(\"Teams\")\n\n-- Command to choose a team (note the trailing space)\nlocal joinCommand = \"/jointeam \"\n\nlocal function findTeamByName(name)\n\t-- First, check for the exact name of a team\n\tif Teams:FindFirstChild(name) then\n\t\treturn Teams[name]\n\tend\n\t-- Let's check for case-insensitive partial matches, like \"red\" for \"Red Robins\"\n\tfor _, team in pairs(Teams:GetChildren()) do\n\t\tif team.Name:sub(1, name:len()):lower() == name:lower() then\n\t\t\treturn team\n\t\tend\n\tend\n\t-- If we get to this point, no team matched the one we were looking for :(\nend\n\nlocal function onPlayerChatted(player, message, _recipient)\n\t-- Note: string.sub(message, ...) is the same as message:sub(...)\n\tif message:sub(1, joinCommand:len()):lower() == joinCommand:lower() then\n\t\t-- Matched \"/JOINTEAM xyz\" to our join command prefix \"/jointeam \"\n\t\tlocal teamName = message:sub(joinCommand:len() + 1) -- Cut out the \"xyz\" from \"/jointeam xyz\"\n\t\tlocal team = findTeamByName(teamName)\n\t\tif team then\n\t\t\t-- Set the team!\n\t\t\tplayer.Team = team\n\t\t\tplayer.Neutral = false\n\t\telse\n\t\t\t-- Tell the player that team could not be found :(\n\t\t\tplayer.Team = nil\n\t\t\tplayer.Neutral = true\n\t\tend\n\tend\nend\n\nlocal function onPlayerAdded(player)\n\tplayer.Chatted:Connect(function(...)\n\t\tonPlayerChatted(player, ...)\n\tend)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "type": "Team", "tags": [ "NOT_REPLICATED" ], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Team", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.TeamColor", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines the Team with which a Player is associated.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 55, "offset": 54 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 55, "offset": 54 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The TeamColor property determines which team a Player is associated with\naccording to that Team's ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 26, "offset": 98 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Team.TeamColor" } ], "position": { "start": { "line": 2, "column": 26, "offset": 98 }, "end": { "line": 2, "column": 48, "offset": 120 } } }, { "type": "text", "value": ". Changing this property\nwill change ", "position": { "start": { "line": 2, "column": 48, "offset": 120 }, "end": { "line": 3, "column": 13, "offset": 157 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Team" } ], "position": { "start": { "line": 3, "column": 13, "offset": 157 }, "end": { "line": 3, "column": 32, "offset": 176 } } }, { "type": "text", "value": " according to whichever team has the same\n", "position": { "start": { "line": 3, "column": 32, "offset": 176 }, "end": { "line": 4, "column": 1, "offset": 218 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Datatype.BrickColor" } ], "position": { "start": { "line": 4, "column": 1, "offset": 218 }, "end": { "line": 4, "column": 22, "offset": 239 } } }, { "type": "text", "value": " for their ", "position": { "start": { "line": 4, "column": 22, "offset": 239 }, "end": { "line": 4, "column": 33, "offset": 250 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Team.TeamColor" } ], "position": { "start": { "line": 4, "column": 33, "offset": 250 }, "end": { "line": 4, "column": 55, "offset": 272 } } }, { "type": "text", "value": ". If no Team object\nhas the associated TeamColor, the player will not be associated with a\nteam.", "position": { "start": { "line": 4, "column": 55, "offset": 272 }, "end": { "line": 6, "column": 6, "offset": 368 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 6, "column": 6, "offset": 368 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "It's often a better idea to set ", "position": { "start": { "line": 8, "column": 1, "offset": 370 }, "end": { "line": 8, "column": 33, "offset": 402 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Team" } ], "position": { "start": { "line": 8, "column": 33, "offset": 402 }, "end": { "line": 8, "column": 52, "offset": 421 } } }, { "type": "text", "value": " to the respective\n", "position": { "start": { "line": 8, "column": 52, "offset": 421 }, "end": { "line": 9, "column": 1, "offset": 440 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Team" } ], "position": { "start": { "line": 9, "column": 1, "offset": 440 }, "end": { "line": 9, "column": 13, "offset": 452 } } }, { "type": "text", "value": " instead of using this property. Setting this property often\nleads to repetition of the same BrickColor value for a certain team across\nmany scripts; this is something you want to avoid when adhering to the\n", "position": { "start": { "line": 9, "column": 13, "offset": 452 }, "end": { "line": 12, "column": 1, "offset": 659 } } }, { "type": "element", "tagName": "a", "properties": { "href": "https://en.wikipedia.org/wiki/Don%27t_repeat_yourself" }, "children": [ { "type": "text", "value": "don't-repeat-yourself", "position": { "start": { "line": 12, "column": 2, "offset": 660 }, "end": { "line": 12, "column": 23, "offset": 681 } } } ], "position": { "start": { "line": 12, "column": 1, "offset": 659 }, "end": { "line": 12, "column": 27, "offset": 685 } } }, { "type": "text", "value": " principle.", "position": { "start": { "line": 12, "column": 27, "offset": 685 }, "end": { "line": 12, "column": 38, "offset": 696 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 370 }, "end": { "line": 12, "column": 38, "offset": 696 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Playing-Spectating-Teams", "displayName": "Playing/Spectating Teams", "description": "This code sample, although lengthy, is quite simple: detect when a player\nchats /play, then put them on the \"Playing\" team. When they die, move them\nback to the \"Spectating\" team.\n", "codeSample": "local Players = game:GetService(\"Players\")\nlocal Teams = game:GetService(\"Teams\")\n\nlocal teamPlaying = Teams.Playing\nlocal teamSpectators = Teams.Spectating\n\nlocal playCommand = \"/play\"\n\nlocal function play(player)\n\tplayer.Team = teamPlaying\n\tplayer.TeamColor = teamPlaying.TeamColor\n\t-- Respawn the player (moves them to spawn location)\n\tplayer:LoadCharacter()\nend\n\nlocal function onPlayerDied(player, _character)\n\t-- When someone dies, put them on the spectator team\n\tplayer.Team = teamSpectators\nend\n\nlocal function onPlayerSpawned(player, character)\n\tlocal human = character:WaitForChild(\"Humanoid\")\n\thuman.Died:Connect(function()\n\t\tonPlayerDied(player, character)\n\tend)\nend\n\nlocal function onPlayerChatted(player, message)\n\tif message:sub(1, playCommand:len()):lower() == playCommand then\n\t\tplay(player)\n\tend\nend\n\nlocal function onPlayerAdded(player)\n\tif player.Character then\n\t\tonPlayerSpawned(player, player.Character)\n\tend\n\tplayer.CharacterAdded:Connect(function()\n\t\tonPlayerSpawned(player, player.Character)\n\tend)\n\tplayer.Chatted:Connect(function(message, _recipient)\n\t\tonPlayerChatted(player, message)\n\tend)\nend\n\nfor _, player in pairs(Players:GetPlayers()) do\n\tonPlayerAdded(player)\nend\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "type": "BrickColor", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Team", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Player.UserId", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A unique identifying integer assigned to all user accounts.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 60, "offset": 59 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 60, "offset": 59 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The UserId is a ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 17, "offset": 16 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 17, "offset": 16 }, "end": { "line": 1, "column": 31, "offset": 30 } } }, { "type": "text", "value": " property that contains a read-only integer\nthat ", "position": { "start": { "line": 1, "column": 31, "offset": 30 }, "end": { "line": 2, "column": 6, "offset": 79 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "uniquely and consistently", "position": { "start": { "line": 2, "column": 8, "offset": 81 }, "end": { "line": 2, "column": 33, "offset": 106 } } } ], "position": { "start": { "line": 2, "column": 6, "offset": 79 }, "end": { "line": 2, "column": 35, "offset": 108 } } }, { "type": "text", "value": " identifies every user account on\nRoblox. Unlike the ", "position": { "start": { "line": 2, "column": 35, "offset": 108 }, "end": { "line": 3, "column": 20, "offset": 161 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name" } ], "position": { "start": { "line": 3, "column": 20, "offset": 161 }, "end": { "line": 3, "column": 41, "offset": 182 } } }, { "type": "text", "value": " of a Player, which may change\naccording the user's present username, this value will never change for\nthe same account.", "position": { "start": { "line": 3, "column": 41, "offset": 182 }, "end": { "line": 5, "column": 18, "offset": 302 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 5, "column": 18, "offset": 302 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property is essential when saving/loading player data using\n", "position": { "start": { "line": 7, "column": 1, "offset": 304 }, "end": { "line": 8, "column": 1, "offset": 369 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.GlobalDataStore|GlobalDataStores" } ], "position": { "start": { "line": 8, "column": 1, "offset": 369 }, "end": { "line": 8, "column": 41, "offset": 409 } } }, { "type": "text", "value": ". Use a player's UserId as the\ndata store key so that each player has a unique key.", "position": { "start": { "line": 8, "column": 41, "offset": 409 }, "end": { "line": 9, "column": 53, "offset": 492 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 304 }, "end": { "line": 9, "column": 53, "offset": 492 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-UserId1", "displayName": "Player.UserId", "description": "The below example would print the UserId of every user who entered a game.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n\tprint(player.UserId)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" }, { "identifier": "Players-GetPlayerByUserId1", "displayName": "Players:GetPlayerByUserId", "description": "", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players:GetPlayerByUserId(1)\n\nif player then\n\tprint(\"Player with userId 1 is in this server! Their name is: \" .. player.Name)\nelse\n\tprint(\"Player with userId 1 is not in this server!\")\nend", "expectedOutput": "", "highlightLines": "" }, { "identifier": "Met-the-creator-badge", "displayName": "Met the Creator Badge", "description": "The following code sample gives an example of a 'met the creator' badge\nsystem. This script will award a specified badge (BADGE_ID) to anyone who is\nin a server at the same time as the user associated with OWNER_ID.\n", "codeSample": "local BadgeService = game:GetService(\"BadgeService\")\nlocal Players = game:GetService(\"Players\")\n\nlocal OWNER_ID = 212423 -- can use game.CreatorId for published places\nlocal BADGE_ID = 1\n\nlocal ownerInGame = false\n\nlocal function playerAdded(newPlayer)\n\tif newPlayer.UserId == OWNER_ID then\n\t\t-- if new player is the owner, set ownerInGame to true and give everyone the badge\n\t\townerInGame = true\n\t\tfor _, player in pairs(Players:GetPlayers()) do\n\t\t\t-- don't award the owner\n\t\t\tif player ~= newPlayer then\n\t\t\t\tBadgeService:AwardBadge(player.UserId, BADGE_ID)\n\t\t\tend\n\t\tend\n\telseif ownerInGame then\n\t\t-- if the owner is in the game, award the badge\n\t\tBadgeService:AwardBadge(newPlayer.UserId, BADGE_ID)\n\tend\nend\n\nlocal function playerRemoving(oldPlayer)\n\tif oldPlayer.UserId == OWNER_ID then\n\t\townerInGame = false\n\tend\nend\n\nPlayers.PlayerAdded:Connect(playerAdded)\nPlayers.PlayerRemoving:Connect(playerRemoving)", "expectedOutput": "", "highlightLines": "" }, { "identifier": "GlobalDataStore-GetAsync1", "displayName": "Data Store to Leaderboard", "description": "This code sample retrieves a player's saved gold from a data store and puts\nthe returned value onto the leaderboard. Note that this sample does not save\nplayers' gold — it only loads it.\n", "codeSample": "local Players = game:GetService(\"Players\")\nlocal DataStoreService = game:GetService(\"DataStoreService\")\n\nlocal goldDataStore = DataStoreService:GetDataStore(\"Gold\")\n\nlocal STARTING_GOLD = 100\n\nlocal function onPlayerAdded(player)\n\tlocal playerKey = \"Player_\" .. player.UserId\n\n\tlocal leaderstats = Instance.new(\"IntValue\")\n\tleaderstats.Name = \"leaderstats\"\n\n\tlocal gold = Instance.new(\"IntValue\")\n\tgold.Name = \"Gold\"\n\tgold.Parent = leaderstats\n\n\tlocal success, result = pcall(function()\n\t\treturn goldDataStore:GetAsync(playerKey) or STARTING_GOLD\n\tend)\n\tif success then\n\t\tgold.Value = result\n\telse\n\t\t-- Failed to retrieve data\n\t\twarn(result)\n\tend\n\n\tleaderstats.Parent = player\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "type": "int64", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Player.userId", "summary": "", "description": "", "codeSamples": null, "type": "int64", "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property is a deprecated variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.UserId" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 63, "offset": 62 } } }, { "type": "text", "value": " which\nshould be used instead.", "position": { "start": { "line": 1, "column": 63, "offset": 62 }, "end": { "line": 2, "column": 24, "offset": 92 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 24, "offset": 92 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" } ], "methods": [ { "name": "Player:ClearCharacterAppearance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Removes all accessories and other character appearance objects from a\nplayer's Character.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 20, "offset": 89 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 20, "offset": 89 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ClearCharacterAppearance function removes all ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 51, "offset": 50 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Accessory" } ], "position": { "start": { "line": 1, "column": 51, "offset": 50 }, "end": { "line": 1, "column": 68, "offset": 67 } } }, { "type": "text", "value": ",\n", "position": { "start": { "line": 1, "column": 68, "offset": 67 }, "end": { "line": 2, "column": 1, "offset": 69 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Shirt" } ], "position": { "start": { "line": 2, "column": 1, "offset": 69 }, "end": { "line": 2, "column": 14, "offset": 82 } } }, { "type": "text", "value": ", ", "position": { "start": { "line": 2, "column": 14, "offset": 82 }, "end": { "line": 2, "column": 16, "offset": 84 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Pants" } ], "position": { "start": { "line": 2, "column": 16, "offset": 84 }, "end": { "line": 2, "column": 29, "offset": 97 } } }, { "type": "text", "value": ", ", "position": { "start": { "line": 2, "column": 29, "offset": 97 }, "end": { "line": 2, "column": 31, "offset": 99 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.CharacterMesh" } ], "position": { "start": { "line": 2, "column": 31, "offset": 99 }, "end": { "line": 2, "column": 52, "offset": 120 } } }, { "type": "text", "value": ", and\n", "position": { "start": { "line": 2, "column": 52, "offset": 120 }, "end": { "line": 3, "column": 1, "offset": 126 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.BodyColors" } ], "position": { "start": { "line": 3, "column": 1, "offset": 126 }, "end": { "line": 3, "column": 19, "offset": 144 } } }, { "type": "text", "value": " from the given player's ", "position": { "start": { "line": 3, "column": 19, "offset": 144 }, "end": { "line": 3, "column": 44, "offset": 169 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 3, "column": 44, "offset": 169 }, "end": { "line": 3, "column": 68, "offset": 193 } } }, { "type": "text", "value": ". In\naddition, it also removes the T-Shirt ", "position": { "start": { "line": 3, "column": 68, "offset": 193 }, "end": { "line": 4, "column": 39, "offset": 236 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Decal" } ], "position": { "start": { "line": 4, "column": 39, "offset": 236 }, "end": { "line": 4, "column": 52, "offset": 249 } } }, { "type": "text", "value": " on the player's torso.\nThe character's body part colors and face will remain unchanged. This\nmethod does nothing if the player does not have a Character.", "position": { "start": { "line": 4, "column": 52, "offset": 249 }, "end": { "line": 6, "column": 61, "offset": 403 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 6, "column": 61, "offset": 403 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "It does not remove ", "position": { "start": { "line": 8, "column": 1, "offset": 405 }, "end": { "line": 8, "column": 20, "offset": 424 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.ShirtGraphic|t-shirts" } ], "position": { "start": { "line": 8, "column": 20, "offset": 424 }, "end": { "line": 8, "column": 49, "offset": 453 } } }, { "type": "text", "value": ", head meshes, or faces.", "position": { "start": { "line": 8, "column": 49, "offset": 453 }, "end": { "line": 8, "column": 73, "offset": 477 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 405 }, "end": { "line": 8, "column": 73, "offset": 477 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-ClearCharacterAppearance1", "displayName": "How to Clear a Character's Appearance", "description": "", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nlocal character = player.Character or player.CharacterAdded:Wait()\n\nlocal function onChildRemoved(child)\n\tprint(child.ClassName, \"removed from character\")\nend\n\ncharacter.ChildRemoved:Connect(onChildRemoved)\n\nplayer:ClearCharacterAppearance()\n--> BodyColors removed from character\n--> ShirtGraphic removed from character\n--> Shirt removed from character\n--> Pants removed from character\n--> CharacterMesh removed from character\n--> Hat removed from character\n--> Shirt removed from character", "expectedOutput": "", "highlightLines": "" } ], "parameters": [], "returns": [ { "type": "void", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:DistanceFromCharacter", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the distance between the character's head and the given Vector3\npoint. Returns 0 if the player has no character.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 49, "offset": 120 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 49, "offset": 120 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The DistanceFromCharacter ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 27, "offset": 26 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 27, "offset": 26 }, "end": { "line": 1, "column": 41, "offset": 40 } } }, { "type": "text", "value": " function returns the distance\nbetween the character's head and the given ", "position": { "start": { "line": 1, "column": 41, "offset": 40 }, "end": { "line": 2, "column": 44, "offset": 114 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Datatype.Vector3" } ], "position": { "start": { "line": 2, "column": 44, "offset": 114 }, "end": { "line": 2, "column": 62, "offset": 132 } } }, { "type": "text", "value": " point. It\nreturns 0 if the player has no ", "position": { "start": { "line": 2, "column": 62, "offset": 132 }, "end": { "line": 3, "column": 32, "offset": 174 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 3, "column": 32, "offset": 174 }, "end": { "line": 3, "column": 56, "offset": 198 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 3, "column": 56, "offset": 198 }, "end": { "line": 3, "column": 57, "offset": 199 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 57, "offset": 199 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This is useful when determining the distance between a player and another\nobject or location in game.", "position": { "start": { "line": 5, "column": 1, "offset": 201 }, "end": { "line": 6, "column": 28, "offset": 302 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 201 }, "end": { "line": 6, "column": 28, "offset": 302 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If you would like to determine the distance between two non-player\ninstances or positions, you can use the following:", "position": { "start": { "line": 8, "column": 1, "offset": 304 }, "end": { "line": 9, "column": 51, "offset": 421 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 304 }, "end": { "line": 9, "column": 51, "offset": 421 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local distance = (position1 - position2).magnitude\n" } ], "position": { "start": { "line": 11, "column": 1, "offset": 423 }, "end": { "line": 13, "column": 4, "offset": 484 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 423 }, "end": { "line": 13, "column": 4, "offset": 484 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-DistanceFromCharacter1", "displayName": "Measuring the Distance Between a Player and a Position", "description": "This example demonstrates how to measure the distance between a player's\n`Class.Player.Character` and another location.\n\nThis code will print the distance of each player's character from the origin\n(0, 0, 0):\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nfor _, player in pairs(Players:GetPlayers()) do\n\tprint(player:DistanceFromCharacter(Vector3.new(0, 0, 0)))\nend", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "point", "type": "Vector3", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The location from which player's distance to is being measured.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 64, "offset": 63 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 64, "offset": 63 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "float", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The distance in studs between the player and the location.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:GetJoinData", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns a dictionary containing information describing how the\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 63 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 2, "column": 1, "offset": 63 }, "end": { "line": 2, "column": 15, "offset": 77 } } }, { "type": "text", "value": " joins the experience.", "position": { "start": { "line": 2, "column": 15, "offset": 77 }, "end": { "line": 2, "column": 37, "offset": 99 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 37, "offset": 99 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns a dictionary containing information describing how the Player\njoins the experience. The dictionary contains any of the following fields:", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 75, "offset": 144 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 75, "offset": 144 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "table", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 4, "column": 8, "offset": 153 }, "end": { "line": 5, "column": 3, "offset": 156 } } }, { "type": "element", "tagName": "thead", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 5, "column": 10, "offset": 163 }, "end": { "line": 6, "column": 5, "offset": 168 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 6, "column": 9, "offset": 172 }, "end": { "line": 7, "column": 7, "offset": 179 } } }, { "type": "element", "tagName": "th", "properties": {}, "children": [ { "type": "text", "value": " Key ", "position": { "start": { "line": 7, "column": 11, "offset": 183 }, "end": { "line": 7, "column": 16, "offset": 188 } } } ], "position": { "start": { "line": 7, "column": 7, "offset": 179 }, "end": { "line": 7, "column": 21, "offset": 193 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 7, "column": 21, "offset": 193 }, "end": { "line": 8, "column": 7, "offset": 200 } } }, { "type": "element", "tagName": "th", "properties": {}, "children": [ { "type": "text", "value": " Value Type ", "position": { "start": { "line": 8, "column": 11, "offset": 204 }, "end": { "line": 8, "column": 23, "offset": 216 } } } ], "position": { "start": { "line": 8, "column": 7, "offset": 200 }, "end": { "line": 8, "column": 28, "offset": 221 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 8, "column": 28, "offset": 221 }, "end": { "line": 9, "column": 7, "offset": 228 } } }, { "type": "element", "tagName": "th", "properties": {}, "children": [ { "type": "text", "value": " Description ", "position": { "start": { "line": 9, "column": 11, "offset": 232 }, "end": { "line": 9, "column": 24, "offset": 245 } } } ], "position": { "start": { "line": 9, "column": 7, "offset": 228 }, "end": { "line": 9, "column": 29, "offset": 250 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 9, "column": 29, "offset": 250 }, "end": { "line": 10, "column": 5, "offset": 255 } } } ], "position": { "start": { "line": 6, "column": 5, "offset": 168 }, "end": { "line": 10, "column": 10, "offset": 260 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 10, "column": 10, "offset": 260 }, "end": { "line": 11, "column": 3, "offset": 263 } } } ], "position": { "start": { "line": 5, "column": 3, "offset": 156 }, "end": { "line": 11, "column": 11, "offset": 271 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 11, "column": 11, "offset": 271 }, "end": { "line": 12, "column": 3, "offset": 274 } } }, { "type": "element", "tagName": "tbody", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 12, "column": 10, "offset": 281 }, "end": { "line": 13, "column": 5, "offset": 286 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": " \n ", "position": { "start": { "line": 13, "column": 9, "offset": 290 }, "end": { "line": 14, "column": 7, "offset": 311 } } }, { "type": "element", "tagName": "th", "properties": {}, "children": [ { "type": "text", "value": " SourceGameId ", "position": { "start": { "line": 14, "column": 11, "offset": 315 }, "end": { "line": 14, "column": 25, "offset": 329 } } } ], "position": { "start": { "line": 14, "column": 7, "offset": 311 }, "end": { "line": 14, "column": 30, "offset": 334 } } }, { "type": "text", "value": " \n ", "position": { "start": { "line": 14, "column": 30, "offset": 334 }, "end": { "line": 15, "column": 7, "offset": 343 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": " number ", "position": { "start": { "line": 15, "column": 11, "offset": 347 }, "end": { "line": 15, "column": 19, "offset": 355 } } } ], "position": { "start": { "line": 15, "column": 7, "offset": 343 }, "end": { "line": 15, "column": 24, "offset": 360 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 15, "column": 24, "offset": 360 }, "end": { "line": 16, "column": 7, "offset": 367 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": " The ", "position": { "start": { "line": 16, "column": 11, "offset": 371 }, "end": { "line": 16, "column": 16, "offset": 376 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataModel.GameId", "position": { "start": { "line": 16, "column": 22, "offset": 382 }, "end": { "line": 16, "column": 44, "offset": 404 } } } ], "position": { "start": { "line": 16, "column": 16, "offset": 376 }, "end": { "line": 16, "column": 51, "offset": 411 } } }, { "type": "text", "value": " of the experience the ", "position": { "start": { "line": 16, "column": 51, "offset": 411 }, "end": { "line": 16, "column": 74, "offset": 434 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Player", "position": { "start": { "line": 16, "column": 80, "offset": 440 }, "end": { "line": 16, "column": 86, "offset": 446 } } } ], "position": { "start": { "line": 16, "column": 74, "offset": 434 }, "end": { "line": 16, "column": 93, "offset": 453 } } }, { "type": "text", "value": " teleported from. Only present if the player teleports to the current experience and if a server calls the teleport function. ", "position": { "start": { "line": 16, "column": 93, "offset": 453 }, "end": { "line": 16, "column": 219, "offset": 579 } } } ], "position": { "start": { "line": 16, "column": 7, "offset": 367 }, "end": { "line": 16, "column": 224, "offset": 584 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 16, "column": 224, "offset": 584 }, "end": { "line": 17, "column": 5, "offset": 589 } } } ], "position": { "start": { "line": 13, "column": 5, "offset": 286 }, "end": { "line": 17, "column": 10, "offset": 594 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 17, "column": 10, "offset": 594 }, "end": { "line": 18, "column": 5, "offset": 599 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": " \n ", "position": { "start": { "line": 18, "column": 9, "offset": 603 }, "end": { "line": 19, "column": 7, "offset": 624 } } }, { "type": "element", "tagName": "th", "properties": {}, "children": [ { "type": "text", "value": " SourcePlaceId ", "position": { "start": { "line": 19, "column": 11, "offset": 628 }, "end": { "line": 19, "column": 26, "offset": 643 } } } ], "position": { "start": { "line": 19, "column": 7, "offset": 624 }, "end": { "line": 19, "column": 31, "offset": 648 } } }, { "type": "text", "value": " \n ", "position": { "start": { "line": 19, "column": 31, "offset": 648 }, "end": { "line": 20, "column": 7, "offset": 657 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": " number ", "position": { "start": { "line": 20, "column": 11, "offset": 661 }, "end": { "line": 20, "column": 19, "offset": 669 } } } ], "position": { "start": { "line": 20, "column": 7, "offset": 657 }, "end": { "line": 20, "column": 24, "offset": 674 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 20, "column": 24, "offset": 674 }, "end": { "line": 21, "column": 7, "offset": 681 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": " The ", "position": { "start": { "line": 21, "column": 11, "offset": 685 }, "end": { "line": 21, "column": 16, "offset": 690 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataModel.PlaceId", "position": { "start": { "line": 21, "column": 22, "offset": 696 }, "end": { "line": 21, "column": 45, "offset": 719 } } } ], "position": { "start": { "line": 21, "column": 16, "offset": 690 }, "end": { "line": 21, "column": 52, "offset": 726 } } }, { "type": "text", "value": " of the place the ", "position": { "start": { "line": 21, "column": 52, "offset": 726 }, "end": { "line": 21, "column": 70, "offset": 744 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Player", "position": { "start": { "line": 21, "column": 76, "offset": 750 }, "end": { "line": 21, "column": 82, "offset": 756 } } } ], "position": { "start": { "line": 21, "column": 70, "offset": 744 }, "end": { "line": 21, "column": 89, "offset": 763 } } }, { "type": "text", "value": " teleported from. Only present if the player teleports to the current place and a server calls the teleport function. ", "position": { "start": { "line": 21, "column": 89, "offset": 763 }, "end": { "line": 21, "column": 207, "offset": 881 } } } ], "position": { "start": { "line": 21, "column": 7, "offset": 681 }, "end": { "line": 21, "column": 212, "offset": 886 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 21, "column": 212, "offset": 886 }, "end": { "line": 22, "column": 5, "offset": 891 } } } ], "position": { "start": { "line": 18, "column": 5, "offset": 599 }, "end": { "line": 22, "column": 10, "offset": 896 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 22, "column": 10, "offset": 896 }, "end": { "line": 23, "column": 5, "offset": 901 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": " \n ", "position": { "start": { "line": 23, "column": 9, "offset": 905 }, "end": { "line": 24, "column": 7, "offset": 919 } } }, { "type": "element", "tagName": "th", "properties": {}, "children": [ { "type": "text", "value": " Members ", "position": { "start": { "line": 24, "column": 11, "offset": 923 }, "end": { "line": 24, "column": 20, "offset": 932 } } } ], "position": { "start": { "line": 24, "column": 7, "offset": 919 }, "end": { "line": 24, "column": 25, "offset": 937 } } }, { "type": "text", "value": " \n ", "position": { "start": { "line": 24, "column": 25, "offset": 937 }, "end": { "line": 25, "column": 7, "offset": 950 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": " array ", "position": { "start": { "line": 25, "column": 11, "offset": 954 }, "end": { "line": 25, "column": 18, "offset": 961 } } } ], "position": { "start": { "line": 25, "column": 7, "offset": 950 }, "end": { "line": 25, "column": 23, "offset": 966 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 25, "column": 23, "offset": 966 }, "end": { "line": 26, "column": 7, "offset": 973 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": " An array containing the ", "position": { "start": { "line": 26, "column": 11, "offset": 977 }, "end": { "line": 26, "column": 36, "offset": 1002 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.UserId", "position": { "start": { "line": 26, "column": 42, "offset": 1008 }, "end": { "line": 26, "column": 61, "offset": 1027 } } } ], "position": { "start": { "line": 26, "column": 36, "offset": 1002 }, "end": { "line": 26, "column": 68, "offset": 1034 } } }, { "type": "text", "value": " numbers of the users teleported alongside the ", "position": { "start": { "line": 26, "column": 68, "offset": 1034 }, "end": { "line": 26, "column": 115, "offset": 1081 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Player", "position": { "start": { "line": 26, "column": 121, "offset": 1087 }, "end": { "line": 26, "column": 127, "offset": 1093 } } } ], "position": { "start": { "line": 26, "column": 115, "offset": 1081 }, "end": { "line": 26, "column": 134, "offset": 1100 } } }, { "type": "text", "value": ". Only present if the player teleported as part of a group. ", "position": { "start": { "line": 26, "column": 134, "offset": 1100 }, "end": { "line": 26, "column": 194, "offset": 1160 } } } ], "position": { "start": { "line": 26, "column": 7, "offset": 973 }, "end": { "line": 26, "column": 199, "offset": 1165 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 26, "column": 199, "offset": 1165 }, "end": { "line": 27, "column": 5, "offset": 1170 } } } ], "position": { "start": { "line": 23, "column": 5, "offset": 901 }, "end": { "line": 27, "column": 10, "offset": 1175 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 27, "column": 10, "offset": 1175 }, "end": { "line": 28, "column": 5, "offset": 1180 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": " \n ", "position": { "start": { "line": 28, "column": 9, "offset": 1184 }, "end": { "line": 29, "column": 7, "offset": 1194 } } }, { "type": "element", "tagName": "th", "properties": {}, "children": [ { "type": "text", "value": " TeleportData ", "position": { "start": { "line": 29, "column": 11, "offset": 1198 }, "end": { "line": 29, "column": 25, "offset": 1212 } } } ], "position": { "start": { "line": 29, "column": 7, "offset": 1194 }, "end": { "line": 29, "column": 30, "offset": 1217 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 29, "column": 30, "offset": 1217 }, "end": { "line": 30, "column": 7, "offset": 1224 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": " variant ", "position": { "start": { "line": 30, "column": 11, "offset": 1228 }, "end": { "line": 30, "column": 20, "offset": 1237 } } } ], "position": { "start": { "line": 30, "column": 7, "offset": 1224 }, "end": { "line": 30, "column": 25, "offset": 1242 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 30, "column": 25, "offset": 1242 }, "end": { "line": 31, "column": 7, "offset": 1249 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": " Reflects the ", "position": { "start": { "line": 31, "column": 11, "offset": 1253 }, "end": { "line": 31, "column": 25, "offset": 1267 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "teleportData", "position": { "start": { "line": 31, "column": 31, "offset": 1273 }, "end": { "line": 31, "column": 43, "offset": 1285 } } } ], "position": { "start": { "line": 31, "column": 25, "offset": 1267 }, "end": { "line": 31, "column": 50, "offset": 1292 } } }, { "type": "text", "value": " specified in the original teleport. Useful for sharing information between servers the player teleports to. Only present if ", "position": { "start": { "line": 31, "column": 50, "offset": 1292 }, "end": { "line": 31, "column": 175, "offset": 1417 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "teleportData", "position": { "start": { "line": 31, "column": 181, "offset": 1423 }, "end": { "line": 31, "column": 193, "offset": 1435 } } } ], "position": { "start": { "line": 31, "column": 175, "offset": 1417 }, "end": { "line": 31, "column": 200, "offset": 1442 } } }, { "type": "text", "value": " was specified and a server calls the teleport function. ", "position": { "start": { "line": 31, "column": 200, "offset": 1442 }, "end": { "line": 31, "column": 257, "offset": 1499 } } } ], "position": { "start": { "line": 31, "column": 7, "offset": 1249 }, "end": { "line": 31, "column": 262, "offset": 1504 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 31, "column": 262, "offset": 1504 }, "end": { "line": 32, "column": 5, "offset": 1509 } } } ], "position": { "start": { "line": 28, "column": 5, "offset": 1180 }, "end": { "line": 32, "column": 10, "offset": 1514 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 32, "column": 10, "offset": 1514 }, "end": { "line": 33, "column": 5, "offset": 1519 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": " \n ", "position": { "start": { "line": 33, "column": 9, "offset": 1523 }, "end": { "line": 34, "column": 7, "offset": 1533 } } }, { "type": "element", "tagName": "th", "properties": {}, "children": [ { "type": "text", "value": " LaunchData ", "position": { "start": { "line": 34, "column": 11, "offset": 1537 }, "end": { "line": 34, "column": 23, "offset": 1549 } } } ], "position": { "start": { "line": 34, "column": 7, "offset": 1533 }, "end": { "line": 34, "column": 28, "offset": 1554 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 34, "column": 28, "offset": 1554 }, "end": { "line": 35, "column": 7, "offset": 1561 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": " string ", "position": { "start": { "line": 35, "column": 11, "offset": 1565 }, "end": { "line": 35, "column": 19, "offset": 1573 } } } ], "position": { "start": { "line": 35, "column": 7, "offset": 1561 }, "end": { "line": 35, "column": 24, "offset": 1578 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 35, "column": 24, "offset": 1578 }, "end": { "line": 36, "column": 7, "offset": 1585 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": " A string containing launch data specified in the URL the player clicks to join the experience. Only present if the URL contains launch data. ", "position": { "start": { "line": 36, "column": 11, "offset": 1589 }, "end": { "line": 36, "column": 153, "offset": 1731 } } } ], "position": { "start": { "line": 36, "column": 7, "offset": 1585 }, "end": { "line": 36, "column": 158, "offset": 1736 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 36, "column": 158, "offset": 1736 }, "end": { "line": 37, "column": 5, "offset": 1741 } } } ], "position": { "start": { "line": 33, "column": 5, "offset": 1519 }, "end": { "line": 37, "column": 10, "offset": 1746 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 37, "column": 10, "offset": 1746 }, "end": { "line": 38, "column": 3, "offset": 1749 } } } ], "position": { "start": { "line": 12, "column": 3, "offset": 274 }, "end": { "line": 38, "column": 11, "offset": 1757 } } }, { "type": "text", "value": "\n", "position": { "start": { "line": 38, "column": 11, "offset": 1757 }, "end": { "line": 39, "column": 1, "offset": 1758 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 146 }, "end": { "line": 39, "column": 9, "offset": 1766 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "GetJoinData and TeleportData", "position": { "start": { "line": 41, "column": 6, "offset": 1773 }, "end": { "line": 41, "column": 34, "offset": 1801 } } } ], "position": { "start": { "line": 41, "column": 1, "offset": 1768 }, "end": { "line": 41, "column": 34, "offset": 1801 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If a server initiates the Player's teleport, the dictionary that this\nmethod returns includes the player's teleport data. The\n", "position": { "start": { "line": 43, "column": 1, "offset": 1803 }, "end": { "line": 45, "column": 1, "offset": 1929 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:GetJoinData()" } ], "position": { "start": { "line": 45, "column": 1, "offset": 1929 }, "end": { "line": 45, "column": 29, "offset": 1957 } } }, { "type": "text", "value": " method can only be used to fetch teleport\ndata on the server. To fetch the data on the client, use\n", "position": { "start": { "line": 45, "column": 29, "offset": 1957 }, "end": { "line": 47, "column": 1, "offset": 2057 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.TeleportService:GetLocalPlayerTeleportData()" } ], "position": { "start": { "line": 47, "column": 1, "offset": 2057 }, "end": { "line": 47, "column": 53, "offset": 2109 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 47, "column": 53, "offset": 2109 }, "end": { "line": 47, "column": 54, "offset": 2110 } } } ], "position": { "start": { "line": 43, "column": 1, "offset": 1803 }, "end": { "line": 47, "column": 54, "offset": 2110 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Unlike ", "position": { "start": { "line": 49, "column": 1, "offset": 2112 }, "end": { "line": 49, "column": 8, "offset": 2119 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.TeleportService:GetLocalPlayerTeleportData()" } ], "position": { "start": { "line": 49, "column": 8, "offset": 2119 }, "end": { "line": 49, "column": 60, "offset": 2171 } } }, { "type": "text", "value": ",\n", "position": { "start": { "line": 49, "column": 60, "offset": 2171 }, "end": { "line": 50, "column": 1, "offset": 2173 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:GetJoinData()" } ], "position": { "start": { "line": 50, "column": 1, "offset": 2173 }, "end": { "line": 50, "column": 29, "offset": 2201 } } }, { "type": "text", "value": " only provides teleport data that meets the\nfollowing security criteria:", "position": { "start": { "line": 50, "column": 29, "offset": 2201 }, "end": { "line": 51, "column": 29, "offset": 2273 } } } ], "position": { "start": { "line": 49, "column": 1, "offset": 2112 }, "end": { "line": 51, "column": 29, "offset": 2273 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "It's guaranteed to have been sent by a Roblox server in the past 48\nhours.", "position": { "start": { "line": 53, "column": 3, "offset": 2277 }, "end": { "line": 54, "column": 9, "offset": 2353 } } } ], "position": { "start": { "line": 53, "column": 1, "offset": 2275 }, "end": { "line": 54, "column": 9, "offset": 2353 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "It's guaranteed to have been sent with this ", "position": { "start": { "line": 55, "column": 3, "offset": 2356 }, "end": { "line": 55, "column": 47, "offset": 2400 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 55, "column": 47, "offset": 2400 }, "end": { "line": 55, "column": 61, "offset": 2414 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 55, "column": 61, "offset": 2414 }, "end": { "line": 55, "column": 62, "offset": 2415 } } } ], "position": { "start": { "line": 55, "column": 1, "offset": 2354 }, "end": { "line": 55, "column": 62, "offset": 2415 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 56, "column": 3, "offset": 2418 }, "end": { "line": 56, "column": 7, "offset": 2422 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "SourcePlaceId" } ], "position": { "start": { "line": 56, "column": 7, "offset": 2422 }, "end": { "line": 56, "column": 22, "offset": 2437 } } }, { "type": "text", "value": " and ", "position": { "start": { "line": 56, "column": 22, "offset": 2437 }, "end": { "line": 56, "column": 27, "offset": 2442 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "SourceGameId" } ], "position": { "start": { "line": 56, "column": 27, "offset": 2442 }, "end": { "line": 56, "column": 41, "offset": 2456 } } }, { "type": "text", "value": " are guaranteed to be the place\nand universe the data was sent from. This means you can verify the\nteleport data came from an approved place.", "position": { "start": { "line": 56, "column": 41, "offset": 2456 }, "end": { "line": 58, "column": 45, "offset": 2601 } } } ], "position": { "start": { "line": 56, "column": 1, "offset": 2416 }, "end": { "line": 58, "column": 45, "offset": 2601 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 53, "column": 1, "offset": 2275 }, "end": { "line": 58, "column": 45, "offset": 2601 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "As this data is transmitted by the client, it can still potentially be\nabused by an exploiter. Sensitive data such as player currency should be\ntransmitted via a secure solution like\n", "position": { "start": { "line": 60, "column": 1, "offset": 2603 }, "end": { "line": 63, "column": 1, "offset": 2786 } } }, { "type": "element", "tagName": "a", "properties": { "href": "/cloud-services/memory-stores" }, "children": [ { "type": "text", "value": "Memory Stores", "position": { "start": { "line": 63, "column": 2, "offset": 2787 }, "end": { "line": 63, "column": 15, "offset": 2800 } } } ], "position": { "start": { "line": 63, "column": 1, "offset": 2786 }, "end": { "line": 63, "column": 47, "offset": 2832 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 63, "column": 47, "offset": 2832 }, "end": { "line": 63, "column": 48, "offset": 2833 } } } ], "position": { "start": { "line": 60, "column": 1, "offset": 2603 }, "end": { "line": 63, "column": 48, "offset": 2833 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "LaunchData", "position": { "start": { "line": 65, "column": 6, "offset": 2840 }, "end": { "line": 65, "column": 16, "offset": 2850 } } } ], "position": { "start": { "line": 65, "column": 1, "offset": 2835 }, "end": { "line": 65, "column": 16, "offset": 2850 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Contains the string embedded in the launchData URL parameter that the user\nclicked to join the experience. Only available on the first join. If the\nuser teleports to another server, the data isn't included. If you need the\ndata after a teleport, forward it manually as teleport data. You can only\ninclude LaunchData in direct join URLs, not URLs to the experience's page.", "position": { "start": { "line": 67, "column": 1, "offset": 2852 }, "end": { "line": 71, "column": 75, "offset": 3223 } } } ], "position": { "start": { "line": 67, "column": 1, "offset": 2852 }, "end": { "line": 71, "column": 75, "offset": 3223 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "LaunchData is a URL parameter that you can create by adding\n", "position": { "start": { "line": 73, "column": 1, "offset": 3225 }, "end": { "line": 74, "column": 1, "offset": 3285 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "&launchData=abcd" } ], "position": { "start": { "line": 74, "column": 1, "offset": 3285 }, "end": { "line": 74, "column": 19, "offset": 3303 } } }, { "type": "text", "value": " to a URL, where ", "position": { "start": { "line": 74, "column": 19, "offset": 3303 }, "end": { "line": 74, "column": 36, "offset": 3320 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "abcd" } ], "position": { "start": { "line": 74, "column": 36, "offset": 3320 }, "end": { "line": 74, "column": 42, "offset": 3326 } } }, { "type": "text", "value": " is the data. Special characters\nsuch as spaces must be URL encoded using ", "position": { "start": { "line": 74, "column": 42, "offset": 3326 }, "end": { "line": 75, "column": 42, "offset": 3400 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.HttpService:UrlEncode()" } ], "position": { "start": { "line": 75, "column": 42, "offset": 3400 }, "end": { "line": 75, "column": 73, "offset": 3431 } } }, { "type": "text", "value": "\nand are automatically decoded when the user joins the game. The decoded\nlaunch data can't exceed 200 bytes. You can store more complex data as a\nJSON string and decode it with ", "position": { "start": { "line": 75, "column": 73, "offset": 3431 }, "end": { "line": 78, "column": 32, "offset": 3608 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.HttpService:JSONDecode()" } ], "position": { "start": { "line": 78, "column": 32, "offset": 3608 }, "end": { "line": 78, "column": 64, "offset": 3640 } } }, { "type": "text", "value": " on the\nserver.", "position": { "start": { "line": 78, "column": 64, "offset": 3640 }, "end": { "line": 79, "column": 8, "offset": 3655 } } } ], "position": { "start": { "line": 73, "column": 1, "offset": 3225 }, "end": { "line": 79, "column": 8, "offset": 3655 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This link joins the LaunchData sample place and starts the user in room 2:\n", "position": { "start": { "line": 81, "column": 1, "offset": 3657 }, "end": { "line": 82, "column": 1, "offset": 3732 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "https://www.roblox.com/games/start?placeId=6900305353&launchData=%7B%22roomId%22%3A%202%7D" } ], "position": { "start": { "line": 82, "column": 1, "offset": 3732 }, "end": { "line": 82, "column": 93, "offset": 3824 } } } ], "position": { "start": { "line": 81, "column": 1, "offset": 3657 }, "end": { "line": 82, "column": 93, "offset": 3824 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "You can also make sure that this link works for users without Roblox\ndownloaded on their mobile devices by using the AppsFlyer version of the\nlink. The above link would look like:", "position": { "start": { "line": 84, "column": 1, "offset": 3826 }, "end": { "line": 86, "column": 38, "offset": 4005 } } } ], "position": { "start": { "line": 84, "column": 1, "offset": 3826 }, "end": { "line": 86, "column": 38, "offset": 4005 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "ro.blox.com/Ebh5?af_dp=https%3A%2F%2Fwww.roblox.com%2Fgames%2Fstart%3FplaceId%3D6900305353%26launchData%3D%257B%2522roomId%2522%253A%25202%257D&af_web_dp=https%3A%2F%2Fwww.roblox.com%2Fgames%2Fstart%3FplaceId%3D6900305353%26launchData%3D%257B%2522roomId%2522%253A%25202%257D" } ], "position": { "start": { "line": 88, "column": 1, "offset": 4007 }, "end": { "line": 88, "column": 277, "offset": 4283 } } } ], "position": { "start": { "line": 88, "column": 1, "offset": 4007 }, "end": { "line": 88, "column": 277, "offset": 4283 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "To build the AppsFlyer version of the link, you need to start the URL with\n", "position": { "start": { "line": 90, "column": 1, "offset": 4285 }, "end": { "line": 91, "column": 1, "offset": 4360 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "ro.blox.com/Ebh5?" } ], "position": { "start": { "line": 91, "column": 1, "offset": 4360 }, "end": { "line": 91, "column": 20, "offset": 4379 } } }, { "type": "text", "value": " and append the af_dp and af_web_dp parameters with the\nURL encoded version of Link 1.", "position": { "start": { "line": 91, "column": 20, "offset": 4379 }, "end": { "line": 92, "column": 31, "offset": 4465 } } } ], "position": { "start": { "line": 90, "column": 1, "offset": 4285 }, "end": { "line": 92, "column": 31, "offset": 4465 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Don't store confidential information in the LaunchData because it's fully\nvisible in the URL. Furthermore, the data might not be authentic because a\nuser can modify the URL.", "position": { "start": { "line": 94, "column": 1, "offset": 4467 }, "end": { "line": 96, "column": 25, "offset": 4640 } } } ], "position": { "start": { "line": 94, "column": 1, "offset": 4467 }, "end": { "line": 96, "column": 25, "offset": 4640 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-GetJoinData-Tracking-Traffic-Sources", "displayName": "Tracking Traffic Sources", "description": "The following example tracks sources of traffic for analytics. By creating\nURLs with unique launch data for each social platform, you can determine the\nmost popular traffic sources. The sample checks the source against a list of\npossible samples and discards any invalid sources because users can modify the\nlaunch data.\n", "codeSample": "local DataStoreService = game:GetService(\"DataStoreService\")\nlocal Players = game:GetService(\"Players\")\n\nlocal analyticsStore = DataStoreService:GetDataStore(\"Analytics\")\n\nlocal ALLOWED_SOURCES = {\n\t\"twitter\";\n\t\"youtube\";\n\t\"discord\";\n}\n\nlocal function onPlayerAdded(player)\n\tlocal source = player:GetJoinData().LaunchData\n\t-- check if the provided source is valid\n\tif source and table.find(ALLOWED_SOURCES, source) then\n\t\t-- update the data store to track the source popularity\n\t\tlocal success, result = pcall(analyticsStore.IncrementAsync, analyticsStore, source)\n\n\t\tif success then\n\t \t print(player.Name, \"joined from\", source, \"- total:\", result)\n\t\telse\n\t \t warn(\"Failed to record join source: \" .. result)\n\t\tend\n\tend\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" }, { "identifier": "Player-GetJoinData-Referral-Url-Generator", "displayName": "Referral URL Generator", "description": "The following example generates a URL with the user's ID used as launch data.\nIt then displays the URL in a read-only text box that makes it easy for the\nuser to copy and share the link with their friends. When a user joins the game\nusing a referral link, you can use the launch data to reward the referrer.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nlocal DIRECT_JOIN_URL = \"https://www.roblox.com/games/start?placeId=%d&launchData=%s\"\n\nlocal textBox = script.Parent\n\nlocal function generateReferralURL(player)\n\treturn DIRECT_JOIN_URL:format(\n\t\tgame.PlaceId,\n\t\tplayer.UserId\n\t)\nend\n\nlocal function highlightAll()\n\tif -- avoid recursive property updates\n\t\ttextBox:IsFocused()\n\t\tand not (\n\t \t textBox.SelectionStart == 1\n\t \t and textBox.CursorPosition == #textBox.Text + 1\n\t\t)\n\tthen\n\t\ttextBox.SelectionStart = 1\n\t\ttextBox.CursorPosition = #textBox.Text + 1\n\tend\nend\n\ntextBox.Focused:Connect(highlightAll)\ntextBox:GetPropertyChangedSignal(\"SelectionStart\"):Connect(highlightAll)\ntextBox:GetPropertyChangedSignal(\"CursorPosition\"):Connect(highlightAll)\n\ntextBox.TextEditable = false\ntextBox.ClearTextOnFocus = false\n\ntextBox.Text = generateReferralURL(player)", "expectedOutput": "", "highlightLines": "" }, { "identifier": "Player-GetJoinData-Table-as-Launch-Data", "displayName": "Using a Table as Launch Data", "description": "The following example is a function that converts a table into a string you\ncan use as launch data. The provided data is JSON encoded, checked for valid\ncharacter length, and escaped with percent signs.\n", "codeSample": "local HttpService = game:GetService(\"HttpService\")\n\nlocal DATA_CHARACTER_LIMIT = 200\n\nlocal function encodeTableAsLaunchData(data)\n\t-- convert the table to a string\n\tlocal jsonEncodedData = HttpService:JSONEncode(data)\n\n\tif #jsonEncodedData <= DATA_CHARACTER_LIMIT then\n\t\t-- escape potentially invalid characters, such as spaces\n\t\tlocal urlEncodedData = HttpService:UrlEncode(jsonEncodedData)\n\t\treturn true, urlEncodedData\n\telse\n\t\t-- report character limit error\n\t\treturn false, (\"Encoded table exceeds %d character limit\"):format(DATA_CHARACTER_LIMIT)\n\tend\nend\n\nlocal sampleData = {\n\tjoinMessage = \"Hello!\";\n\turlCreationDate = os.time();\n\tmagicNumbers = {\n\t\t534;\n\t\t1337;\n\t\t746733573;\n\t};\n}\n\nlocal success, encodedData = encodeTableAsLaunchData(sampleData)\n\nif success then\n\tprint(encodedData)\nelse\n\twarn(\"failed to encode launch data: \" .. encodedData)\nend", "expectedOutput": "", "highlightLines": "" }, { "identifier": "Player-GetJoinData-Decoding-Json-Launch-Data", "displayName": "Decoding JSON Launch Data", "description": "The following example attempts to decode launch data, using `pcall` to prevent\nan error in case the data is corrupt.\n", "codeSample": "local HttpService = game:GetService(\"HttpService\")\nlocal Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n \tlocal launchData = player:GetJoinData().LaunchData\n \tif launchData then\n \t\t-- attempt to decode the data\n \t\tlocal success, result = pcall(HttpService.JSONDecode, HttpService, launchData)\n \t\tif success then\n \t\t\tprint(player.Name, \"joined with data:\", result)\n \t\telse\n \t\t\t-- this is probably due to the user messing with the URL\n \t\t\twarn(\"Failed to parse launch data:\" .. result)\n \t\tend\n \tend\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" }, { "identifier": "server-teleportdata-example", "displayName": "Server TeleportData Example", "description": "The following code sample is an example of how teleport data can be retrieved\non the server using `Class.Player:GetJoinData()`. This code, when ran in a\n`Script` in `ServerScriptService`, will listen for new `Player|Players`\njoining the game. When they join it will retrieve their teleport data\n(verifying it came from a valid place) to find their current level.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal approvedPlaceIds = { 1 } -- insert approved PlaceIds here\n\nlocal function isPlaceIdApproved(placeId)\n\tfor _, id in pairs(approvedPlaceIds) do\n\t\tif id == placeId then\n\t\t\treturn true\n\t\tend\n\tend\n\treturn false\nend\n\nlocal function onPlayerAdded(player)\n\tlocal joinData = player:GetJoinData()\n\n\t-- verify this data was sent by an approved place\n\tif isPlaceIdApproved(joinData.SourcePlaceId) then\n\t\tlocal teleportData = joinData.TeleportData\n\t\tif teleportData then\n\t\t\tlocal currentLevel = teleportData.currentLevel\n\t\t\tprint(player.Name .. \" is on level \" .. currentLevel)\n\t\tend\n\tend\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [], "returns": [ { "type": "Dictionary", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A dictionary containing PlaceId and UserId values (see table in\ndescription).", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 14, "offset": 77 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 14, "offset": 77 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:GetMouse", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the mouse being used by the client.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The GetMouse ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 14, "offset": 13 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 14, "offset": 13 }, "end": { "line": 1, "column": 28, "offset": 27 } } }, { "type": "text", "value": " function returns the ", "position": { "start": { "line": 1, "column": 28, "offset": 27 }, "end": { "line": 1, "column": 50, "offset": 49 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Mouse" } ], "position": { "start": { "line": 1, "column": 50, "offset": 49 }, "end": { "line": 1, "column": 63, "offset": 62 } } }, { "type": "text", "value": " being used\nby the client. The player's mouse instance can be used to track user mouse\ninput including left and right mouse button clicks and movement and\nlocation.", "position": { "start": { "line": 1, "column": 63, "offset": 62 }, "end": { "line": 4, "column": 10, "offset": 226 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 10, "offset": 226 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 6, "column": 1, "offset": 228 }, "end": { "line": 6, "column": 5, "offset": 232 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.UserInputService" } ], "position": { "start": { "line": 6, "column": 5, "offset": 232 }, "end": { "line": 6, "column": 29, "offset": 256 } } }, { "type": "text", "value": " service provides additional functions and\nevents to track user input - especially for devices that do not use a\nmouse.", "position": { "start": { "line": 6, "column": 29, "offset": 256 }, "end": { "line": 8, "column": 7, "offset": 375 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 228 }, "end": { "line": 8, "column": 7, "offset": 375 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note:", "position": { "start": { "line": 10, "column": 1, "offset": 377 }, "end": { "line": 10, "column": 6, "offset": 382 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 377 }, "end": { "line": 10, "column": 6, "offset": 382 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "This item ", "position": { "start": { "line": 12, "column": 3, "offset": 386 }, "end": { "line": 12, "column": 13, "offset": 396 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "must", "position": { "start": { "line": 12, "column": 15, "offset": 398 }, "end": { "line": 12, "column": 19, "offset": 402 } } } ], "position": { "start": { "line": 12, "column": 13, "offset": 396 }, "end": { "line": 12, "column": 21, "offset": 404 } } }, { "type": "text", "value": " be used in a ", "position": { "start": { "line": 12, "column": 21, "offset": 404 }, "end": { "line": 12, "column": 35, "offset": 418 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 12, "column": 35, "offset": 418 }, "end": { "line": 12, "column": 54, "offset": 437 } } }, { "type": "text", "value": " to work as expected\nonline.", "position": { "start": { "line": 12, "column": 54, "offset": 437 }, "end": { "line": 13, "column": 10, "offset": 467 } } } ], "position": { "start": { "line": 12, "column": 1, "offset": 384 }, "end": { "line": 13, "column": 10, "offset": 467 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Following an update in July 2014, the mouse's icon can now be set with\nthis method.", "position": { "start": { "line": 14, "column": 3, "offset": 470 }, "end": { "line": 15, "column": 15, "offset": 555 } } } ], "position": { "start": { "line": 14, "column": 1, "offset": 468 }, "end": { "line": 15, "column": 15, "offset": 555 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 12, "column": 1, "offset": 384 }, "end": { "line": 15, "column": 15, "offset": 555 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-GetMouse1", "displayName": "How to Track Mouse Input", "description": "The below example will print:\n\n> Button 1 is down\n\nwhenever the `Class.Players.LocalPlayer` left clicks.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nlocal mouse = player:GetMouse()\n\nlocal function onButton1Down()\n\tprint(\"Button 1 is down\")\nend\n\nmouse.Button1Down:Connect(onButton1Down)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [], "returns": [ { "type": "Mouse", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:GetNetworkPing", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the isolated network latency in seconds.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "GetNetworkPing", "position": { "start": { "line": 1, "column": 3, "offset": 2 }, "end": { "line": 1, "column": 17, "offset": 16 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 19, "offset": 18 } } }, { "type": "text", "value": " returns the isolated network latency latency of the\n", "position": { "start": { "line": 1, "column": 19, "offset": 18 }, "end": { "line": 2, "column": 1, "offset": 71 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 2, "column": 1, "offset": 71 }, "end": { "line": 2, "column": 15, "offset": 85 } } }, { "type": "text", "value": " in seconds. \"Ping\" is a measurement of the time taken for\ndata to be sent from the client to the server, then back again. It doesn't\ninvolve data deserialization or processing.", "position": { "start": { "line": 2, "column": 15, "offset": 85 }, "end": { "line": 4, "column": 44, "offset": 262 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 44, "offset": 262 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "For client-side ", "position": { "start": { "line": 6, "column": 1, "offset": 264 }, "end": { "line": 6, "column": 17, "offset": 280 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript|LocalScripts" } ], "position": { "start": { "line": 6, "column": 17, "offset": 280 }, "end": { "line": 6, "column": 49, "offset": 312 } } }, { "type": "text", "value": ", this function can only\nbe called on the ", "position": { "start": { "line": 6, "column": 49, "offset": 312 }, "end": { "line": 7, "column": 18, "offset": 354 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players.LocalPlayer" } ], "position": { "start": { "line": 7, "column": 18, "offset": 354 }, "end": { "line": 7, "column": 45, "offset": 381 } } }, { "type": "text", "value": ". This function is useful in\nidentifying and debugging issues that occur in high network latency\nscenarios. It's also useful for masking latency, such as adjusting the\nspeed of throwing animations for projectiles.", "position": { "start": { "line": 7, "column": 45, "offset": 381 }, "end": { "line": 10, "column": 46, "offset": 594 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 264 }, "end": { "line": 10, "column": 46, "offset": 594 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [], "returns": [ { "type": "float", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Player:HasAppearanceLoaded", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns whether or not the appearance of the player's character has\nloaded.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 8, "offset": 75 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 8, "offset": 75 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The HasAppearanceLoaded ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 25, "offset": 24 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 25, "offset": 24 }, "end": { "line": 1, "column": 39, "offset": 38 } } }, { "type": "text", "value": " function returns whether or not the\nappearance of the player's ", "position": { "start": { "line": 1, "column": 39, "offset": 38 }, "end": { "line": 2, "column": 28, "offset": 102 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 2, "column": 28, "offset": 102 }, "end": { "line": 2, "column": 52, "offset": 126 } } }, { "type": "text", "value": " has loaded.", "position": { "start": { "line": 2, "column": 52, "offset": 126 }, "end": { "line": 2, "column": 64, "offset": 138 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 64, "offset": 138 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A player's appearance includes items such as the player's ", "position": { "start": { "line": 4, "column": 1, "offset": 140 }, "end": { "line": 4, "column": 59, "offset": 198 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Shirt" } ], "position": { "start": { "line": 4, "column": 59, "offset": 198 }, "end": { "line": 4, "column": 72, "offset": 211 } } }, { "type": "text", "value": ",\n", "position": { "start": { "line": 4, "column": 72, "offset": 211 }, "end": { "line": 5, "column": 1, "offset": 213 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Pants" } ], "position": { "start": { "line": 5, "column": 1, "offset": 213 }, "end": { "line": 5, "column": 14, "offset": 226 } } }, { "type": "text", "value": ", and ", "position": { "start": { "line": 5, "column": 14, "offset": 226 }, "end": { "line": 5, "column": 20, "offset": 232 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Accessory|Accessories" } ], "position": { "start": { "line": 5, "column": 20, "offset": 232 }, "end": { "line": 5, "column": 49, "offset": 261 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 5, "column": 49, "offset": 261 }, "end": { "line": 5, "column": 50, "offset": 262 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 140 }, "end": { "line": 5, "column": 50, "offset": 262 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This is useful when determining whether a player's appearance has loaded\nafter they first join the game, which can be tracked using the\n", "position": { "start": { "line": 7, "column": 1, "offset": 264 }, "end": { "line": 9, "column": 1, "offset": 400 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players.PlayerAdded" } ], "position": { "start": { "line": 9, "column": 1, "offset": 400 }, "end": { "line": 9, "column": 28, "offset": 427 } } }, { "type": "text", "value": " event.", "position": { "start": { "line": 9, "column": 28, "offset": 427 }, "end": { "line": 9, "column": 35, "offset": 434 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 264 }, "end": { "line": 9, "column": 35, "offset": 434 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "check-if-a-player-s-appearance-has-loaded", "displayName": "Check if a Player's Appearance Has Loaded", "description": "This example prints the result of `Class.Player:HasAppearanceLoaded()` after a\nplayer joins the game until the player's appearance has loaded.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n\tlocal loaded = player:HasAppearanceLoaded()\n\tprint(loaded)\n\n\twhile not loaded do\n\t\tloaded = player:HasAppearanceLoaded()\n\t\tprint(loaded)\n\t\ttask.wait()\n\tend\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [], "returns": [ { "type": "bool", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A boolean indicating whether or not the appearance of the player's\ncharacter has loaded.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 22, "offset": 88 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 22, "offset": 88 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:IsVerified", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns whether the player is verified with concrete, real-world signals.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 74, "offset": 73 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 74, "offset": 73 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns a boolean value indicating that player's verification status. When\ntrue, the player is verified. Verification includes, but isn't limited to,\nnon-VOIP phone number or government ID verification.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 53, "offset": 202 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 53, "offset": 202 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When implementing ", "position": { "start": { "line": 5, "column": 1, "offset": 204 }, "end": { "line": 5, "column": 19, "offset": 222 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "IsVerified" } ], "position": { "start": { "line": 5, "column": 19, "offset": 222 }, "end": { "line": 5, "column": 31, "offset": 234 } } }, { "type": "text", "value": ", exercise caution to ensure that the\nimplementation does not inadvertently block all unverified users.", "position": { "start": { "line": 5, "column": 31, "offset": 234 }, "end": { "line": 6, "column": 66, "offset": 337 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 204 }, "end": { "line": 6, "column": 66, "offset": 337 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note that the method can only be called on the backend server. Calling it\nclient-side results in an error. Additionally, this method will always\nreturn ", "position": { "start": { "line": 8, "column": 1, "offset": 339 }, "end": { "line": 10, "column": 8, "offset": 491 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "false" } ], "position": { "start": { "line": 10, "column": 8, "offset": 491 }, "end": { "line": 10, "column": 15, "offset": 498 } } }, { "type": "text", "value": " in Studio.", "position": { "start": { "line": 10, "column": 15, "offset": 498 }, "end": { "line": 10, "column": 26, "offset": 509 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 339 }, "end": { "line": 10, "column": 26, "offset": 509 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-IsVerified", "displayName": "Using IsVerified", "description": "The following example prints \"true\" if the player is verified.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n print(player:IsVerified())\nend\n\nfor _, player in pairs(Players:GetPlayers()) do\n onPlayerAdded(player)\nend\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [], "returns": [ { "type": "bool", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A boolean indicating whether the player is verified.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 53, "offset": 52 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 53, "offset": 52 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:Kick", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Forcibly disconnect a player from the game, optionally providing a\nmessage.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 9, "offset": 75 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 9, "offset": 75 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Kick|Kick()" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 31, "offset": 30 } } }, { "type": "text", "value": " method allows an experience to gracefully\ndisconnect a client and optionally provide a message to the disconnected\nuser. This is useful for moderating abusive users. You should only allow\nspecific users whom you trust to trigger this method on other users.", "position": { "start": { "line": 1, "column": 31, "offset": 30 }, "end": { "line": 4, "column": 69, "offset": 287 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 69, "offset": 287 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Calling this method on a ", "position": { "start": { "line": 6, "column": 1, "offset": 289 }, "end": { "line": 6, "column": 26, "offset": 314 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 6, "column": 26, "offset": 314 }, "end": { "line": 6, "column": 40, "offset": 328 } } }, { "type": "text", "value": " with no arguments disconnects the\nuser from the server and provides a default notice message. Calling this\nmethod on a ", "position": { "start": { "line": 6, "column": 40, "offset": 328 }, "end": { "line": 8, "column": 13, "offset": 448 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 8, "column": 13, "offset": 448 }, "end": { "line": 8, "column": 27, "offset": 462 } } }, { "type": "text", "value": " along with a string as the first argument\nreplaces the default message with the provided string.", "position": { "start": { "line": 8, "column": 27, "offset": 462 }, "end": { "line": 9, "column": 55, "offset": 559 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 289 }, "end": { "line": 9, "column": 55, "offset": 559 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When using this method from a ", "position": { "start": { "line": 11, "column": 1, "offset": 561 }, "end": { "line": 11, "column": 31, "offset": 591 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 11, "column": 31, "offset": 591 }, "end": { "line": 11, "column": 50, "offset": 610 } } }, { "type": "text", "value": ", only the local user's\nclient can be kicked.", "position": { "start": { "line": 11, "column": 50, "offset": 610 }, "end": { "line": 12, "column": 22, "offset": 655 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 561 }, "end": { "line": 12, "column": 22, "offset": 655 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "message", "type": "string", "default": "\"\"", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The message to show the user upon kicking.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 43, "offset": 42 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 43, "offset": 42 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:LoadBoolean", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns a boolean value that was previously saved to the player with\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 69 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:SaveBoolean()" } ], "position": { "start": { "line": 2, "column": 1, "offset": 69 }, "end": { "line": 2, "column": 29, "offset": 97 } } }, { "type": "text", "value": " with the same key.", "position": { "start": { "line": 2, "column": 29, "offset": 97 }, "end": { "line": 2, "column": 48, "offset": 116 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 48, "offset": 116 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function returns a boolean value that was previously saved to the\nplayer with ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 13, "offset": 83 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:SaveBoolean()" } ], "position": { "start": { "line": 2, "column": 13, "offset": 83 }, "end": { "line": 2, "column": 41, "offset": 111 } } }, { "type": "text", "value": " with the same key. Returns false\nif the key doesn't exist, not nil.", "position": { "start": { "line": 2, "column": 41, "offset": 111 }, "end": { "line": 3, "column": 35, "offset": 179 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 35, "offset": 179 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "bool", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated, as it may have been used for a now obsolete data\npersistence method. Please save and load player data using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 133 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataStoreService" } ], "position": { "start": { "line": 3, "column": 1, "offset": 133 }, "end": { "line": 3, "column": 25, "offset": 157 } } }, { "type": "text", "value": " for new work.", "position": { "start": { "line": 3, "column": 25, "offset": 157 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:LoadCharacterAppearance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Places the given instance either in the player's character, head, or\nStarterGear based on the instance's class.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 43, "offset": 111 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 43, "offset": 111 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The LoadCharacterAppearance ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 29, "offset": 28 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 29, "offset": 28 }, "end": { "line": 1, "column": 43, "offset": 42 } } }, { "type": "text", "value": " function places the given\ninstance either in the player's ", "position": { "start": { "line": 1, "column": 43, "offset": 42 }, "end": { "line": 2, "column": 33, "offset": 101 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 2, "column": 33, "offset": 101 }, "end": { "line": 2, "column": 57, "offset": 125 } } }, { "type": "text", "value": ", head, or\n", "position": { "start": { "line": 2, "column": 57, "offset": 125 }, "end": { "line": 3, "column": 1, "offset": 136 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterGear" } ], "position": { "start": { "line": 3, "column": 1, "offset": 136 }, "end": { "line": 3, "column": 20, "offset": 155 } } }, { "type": "text", "value": " based on the instance's class.", "position": { "start": { "line": 3, "column": 20, "offset": 155 }, "end": { "line": 3, "column": 51, "offset": 186 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 51, "offset": 186 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This is useful when giving a player's character an asset from the Roblox\ncatalog, such as a hat or piece of gear.", "position": { "start": { "line": 5, "column": 1, "offset": 188 }, "end": { "line": 6, "column": 41, "offset": 301 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 188 }, "end": { "line": 6, "column": 41, "offset": 301 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "It is similar to ", "position": { "start": { "line": 8, "column": 1, "offset": 303 }, "end": { "line": 8, "column": 18, "offset": 320 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadCharacter()" } ], "position": { "start": { "line": 8, "column": 18, "offset": 320 }, "end": { "line": 8, "column": 48, "offset": 350 } } }, { "type": "text", "value": ", except it does not reload\nthe entire character instance, StarterGear, or ", "position": { "start": { "line": 8, "column": 48, "offset": 350 }, "end": { "line": 9, "column": 48, "offset": 425 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.PlayerGui" } ], "position": { "start": { "line": 9, "column": 48, "offset": 425 }, "end": { "line": 9, "column": 65, "offset": 442 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 9, "column": 65, "offset": 442 }, "end": { "line": 9, "column": 66, "offset": 443 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 303 }, "end": { "line": 9, "column": 66, "offset": 443 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note:", "position": { "start": { "line": 11, "column": 1, "offset": 445 }, "end": { "line": 11, "column": 6, "offset": 450 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 445 }, "end": { "line": 11, "column": 6, "offset": 450 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Accessory|Accessories" } ], "position": { "start": { "line": 13, "column": 3, "offset": 454 }, "end": { "line": 13, "column": 32, "offset": 483 } } }, { "type": "text", "value": ", ", "position": { "start": { "line": 13, "column": 32, "offset": 483 }, "end": { "line": 13, "column": 34, "offset": 485 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Shirt" } ], "position": { "start": { "line": 13, "column": 34, "offset": 485 }, "end": { "line": 13, "column": 47, "offset": 498 } } }, { "type": "text", "value": "s, ", "position": { "start": { "line": 13, "column": 47, "offset": 498 }, "end": { "line": 13, "column": 50, "offset": 501 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.ShirtGraphic" } ], "position": { "start": { "line": 13, "column": 50, "offset": 501 }, "end": { "line": 13, "column": 70, "offset": 521 } } }, { "type": "text", "value": "s,\n", "position": { "start": { "line": 13, "column": 70, "offset": 521 }, "end": { "line": 14, "column": 1, "offset": 524 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.CharacterMesh" } ], "position": { "start": { "line": 14, "column": 3, "offset": 526 }, "end": { "line": 14, "column": 24, "offset": 547 } } }, { "type": "text", "value": "es, ", "position": { "start": { "line": 14, "column": 24, "offset": 547 }, "end": { "line": 14, "column": 28, "offset": 551 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "BodyColor" } ], "position": { "start": { "line": 14, "column": 28, "offset": 551 }, "end": { "line": 14, "column": 39, "offset": 562 } } }, { "type": "text", "value": "s, and ", "position": { "start": { "line": 14, "column": 39, "offset": 562 }, "end": { "line": 14, "column": 46, "offset": 569 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Accoutrement" } ], "position": { "start": { "line": 14, "column": 46, "offset": 569 }, "end": { "line": 14, "column": 66, "offset": 589 } } }, { "type": "text", "value": "s are\nparented to the player's character.", "position": { "start": { "line": 14, "column": 66, "offset": 589 }, "end": { "line": 15, "column": 38, "offset": 632 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 452 }, "end": { "line": 15, "column": 38, "offset": 632 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Decal" } ], "position": { "start": { "line": 16, "column": 3, "offset": 635 }, "end": { "line": 16, "column": 16, "offset": 648 } } }, { "type": "text", "value": "s, ", "position": { "start": { "line": 16, "column": 16, "offset": 648 }, "end": { "line": 16, "column": 19, "offset": 651 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.FileMesh" } ], "position": { "start": { "line": 16, "column": 19, "offset": 651 }, "end": { "line": 16, "column": 35, "offset": 667 } } }, { "type": "text", "value": "es, ", "position": { "start": { "line": 16, "column": 35, "offset": 667 }, "end": { "line": 16, "column": 39, "offset": 671 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.SpecialMesh" } ], "position": { "start": { "line": 16, "column": 39, "offset": 671 }, "end": { "line": 16, "column": 58, "offset": 690 } } }, { "type": "text", "value": "es,\n", "position": { "start": { "line": 16, "column": 58, "offset": 690 }, "end": { "line": 17, "column": 1, "offset": 694 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.BlockMesh" } ], "position": { "start": { "line": 17, "column": 3, "offset": 696 }, "end": { "line": 17, "column": 20, "offset": 713 } } }, { "type": "text", "value": "es, ", "position": { "start": { "line": 17, "column": 20, "offset": 713 }, "end": { "line": 17, "column": 24, "offset": 717 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.CylinderMesh" } ], "position": { "start": { "line": 17, "column": 24, "offset": 717 }, "end": { "line": 17, "column": 44, "offset": 737 } } }, { "type": "text", "value": "es, and ", "position": { "start": { "line": 17, "column": 44, "offset": 737 }, "end": { "line": 17, "column": 52, "offset": 745 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Texture" } ], "position": { "start": { "line": 17, "column": 52, "offset": 745 }, "end": { "line": 17, "column": 67, "offset": 760 } } }, { "type": "text", "value": "s are\nparented to the character's head.", "position": { "start": { "line": 17, "column": 67, "offset": 760 }, "end": { "line": 18, "column": 36, "offset": 801 } } } ], "position": { "start": { "line": 16, "column": 1, "offset": 633 }, "end": { "line": 18, "column": 36, "offset": 801 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Tool" } ], "position": { "start": { "line": 19, "column": 3, "offset": 804 }, "end": { "line": 19, "column": 15, "offset": 816 } } }, { "type": "text", "value": "s and ", "position": { "start": { "line": 19, "column": 15, "offset": 816 }, "end": { "line": 19, "column": 21, "offset": 822 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.HopperBin" } ], "position": { "start": { "line": 19, "column": 21, "offset": 822 }, "end": { "line": 19, "column": 38, "offset": 839 } } }, { "type": "text", "value": "s are parented to the player's\nStarterGear.", "position": { "start": { "line": 19, "column": 38, "offset": 839 }, "end": { "line": 20, "column": 15, "offset": 884 } } } ], "position": { "start": { "line": 19, "column": 1, "offset": 802 }, "end": { "line": 20, "column": 15, "offset": 884 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "All other classes are ignored.", "position": { "start": { "line": 21, "column": 3, "offset": 887 }, "end": { "line": 21, "column": 33, "offset": 917 } } } ], "position": { "start": { "line": 21, "column": 1, "offset": 885 }, "end": { "line": 21, "column": 33, "offset": 917 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 13, "column": 1, "offset": 452 }, "end": { "line": 21, "column": 33, "offset": 917 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-LoadCharacterAppearance1", "displayName": "Player:LoadCharacterAppearance", "description": "This script gives any Hat/Gear/Face/Body Part to a player once they chat the\nURL of the asset.\n", "codeSample": "local Players = game:GetService(\"Players\")\nlocal InsertService = game:GetService(\"InsertService\")\n\nlocal function onPlayerAdded(player)\n\tlocal function onChatted(message)\n\t\tlocal assetId = message:match(\"id=(%d+)\")\n\t\tif assetId then\n\t\t\tlocal model = InsertService:LoadAsset(assetId)\n\t\t\tfor _, child in pairs(model:GetChildren()) do\n\t\t\t\tplayer:LoadCharacterAppearance(child)\n\t\t\tend\n\t\tend\n\tend\n\n\tplayer.Chatted:Connect(onChatted)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "assetInstance", "type": "Instance", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "An instance of the asset being loaded, which can be obtained using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 67 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.InsertService" } ], "position": { "start": { "line": 2, "column": 1, "offset": 67 }, "end": { "line": 2, "column": 22, "offset": 88 } } }, { "type": "text", "value": "'s ", "position": { "start": { "line": 2, "column": 22, "offset": 88 }, "end": { "line": 2, "column": 25, "offset": 91 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.InsertService:LoadAsset()" } ], "position": { "start": { "line": 2, "column": 25, "offset": 91 }, "end": { "line": 2, "column": 58, "offset": 124 } } }, { "type": "text", "value": " function.", "position": { "start": { "line": 2, "column": 58, "offset": 124 }, "end": { "line": 2, "column": 68, "offset": 134 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 68, "offset": 134 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:LoadInstance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns an instance that was previously saved to the player with\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 65 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:SaveInstance()" } ], "position": { "start": { "line": 2, "column": 1, "offset": 65 }, "end": { "line": 2, "column": 30, "offset": 94 } } }, { "type": "text", "value": " with the same key.", "position": { "start": { "line": 2, "column": 30, "offset": 94 }, "end": { "line": 2, "column": 49, "offset": 113 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 49, "offset": 113 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function returns an instance that was previously saved to the player\nwith ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 6, "offset": 79 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:SaveInstance()" } ], "position": { "start": { "line": 2, "column": 6, "offset": 79 }, "end": { "line": 2, "column": 35, "offset": 108 } } }, { "type": "text", "value": " with the same key. Returns nil if the\nkey doesn't exist.", "position": { "start": { "line": 2, "column": 35, "offset": 108 }, "end": { "line": 3, "column": 19, "offset": 165 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 19, "offset": 165 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-LoadInstance1", "displayName": "Player:LoadInstance", "description": "The below example would reparent the saved instance to Workspace.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n\tif player:WaitForDataReady() then\n\t\tlocal model = player:LoadInstance(\"Model\")\n\t\tmodel.Parent = workspace\n\tend\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "Instance", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated, as it may have been used for a now obsolete data\npersistence method. Please save and load player data using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 133 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataStoreService" } ], "position": { "start": { "line": 3, "column": 1, "offset": 133 }, "end": { "line": 3, "column": 25, "offset": 157 } } }, { "type": "text", "value": " for new work.", "position": { "start": { "line": 3, "column": 25, "offset": 157 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:LoadNumber", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns a number value that was previously saved to the player.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 64, "offset": 63 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 64, "offset": 63 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function was once used by an ancient data persistence method to\nreturn a number value that was previously saved to the player with\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 136 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:SaveNumber()" } ], "position": { "start": { "line": 3, "column": 1, "offset": 136 }, "end": { "line": 3, "column": 28, "offset": 163 } } }, { "type": "text", "value": " with the same key. Returns 0 if the key\ndoesn't exist, not nil.", "position": { "start": { "line": 3, "column": 28, "offset": 163 }, "end": { "line": 4, "column": 24, "offset": 227 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 24, "offset": 227 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-LoadNumber1", "displayName": "Player:LoadNumber", "description": "The below would print the value of the player's TotalPlays.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n\tif player:WaitForDataReady() then\n\t\tprint(player:LoadNumber(\"TotalPlays\"))\n\tend\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "double", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated, as it may have been used for a now obsolete data\npersistence method. Please save and load player data using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 133 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataStoreService" } ], "position": { "start": { "line": 3, "column": 1, "offset": 133 }, "end": { "line": 3, "column": 25, "offset": 157 } } }, { "type": "text", "value": " for new work.", "position": { "start": { "line": 3, "column": 25, "offset": 157 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:LoadString", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns a string value that was previously saved to the player.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 64, "offset": 63 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 64, "offset": 63 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function returns a string value that was previously saved to the\nplayer with ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 13, "offset": 82 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:SaveString()" } ], "position": { "start": { "line": 2, "column": 13, "offset": 82 }, "end": { "line": 2, "column": 40, "offset": 109 } } }, { "type": "text", "value": " with the same key. Returns an\nempty string (\"\") if the key doesn't exist, not nil..", "position": { "start": { "line": 2, "column": 40, "offset": 109 }, "end": { "line": 3, "column": 54, "offset": 193 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 54, "offset": 193 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-LoadString1", "displayName": "Player:LoadString", "description": "The below example would print the value of the previously saved key\n\"TheirName\".\n", "codeSample": "game.Players.PlayerAdded:Connect(function(Player)\n\tif Player:WaitForDataReady() then\n\t\tprint(Player:LoadString(\"TheirName\"))\n\tend\nend)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "string", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated, as it may have been used for a now obsolete data\npersistence method. Please save and load player data using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 133 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataStoreService" } ], "position": { "start": { "line": 3, "column": 1, "offset": 133 }, "end": { "line": 3, "column": 25, "offset": 157 } } }, { "type": "text", "value": " for new work.", "position": { "start": { "line": 3, "column": 25, "offset": 157 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:Move", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Causes the player's character to walk in the given direction until\nstopped, or interrupted by the player (by using their controls).", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 65, "offset": 131 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 65, "offset": 131 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The Move ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 10, "offset": 9 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 10, "offset": 9 }, "end": { "line": 1, "column": 24, "offset": 23 } } }, { "type": "text", "value": " function causes the player's character to walk in\nthe given direction until stopped, or interrupted by the player (by using\ntheir controls).", "position": { "start": { "line": 1, "column": 24, "offset": 23 }, "end": { "line": 3, "column": 17, "offset": 164 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 17, "offset": 164 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This is useful when scripting NPC ", "position": { "start": { "line": 5, "column": 1, "offset": 166 }, "end": { "line": 5, "column": 35, "offset": 200 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Humanoid" } ], "position": { "start": { "line": 5, "column": 35, "offset": 200 }, "end": { "line": 5, "column": 51, "offset": 216 } } }, { "type": "text", "value": "s that move around a\nmap - but are not controlled by an actual player's input.", "position": { "start": { "line": 5, "column": 51, "offset": 216 }, "end": { "line": 6, "column": 58, "offset": 294 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 166 }, "end": { "line": 6, "column": 58, "offset": 294 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note that the function's second argument indicates whether the provided\n", "position": { "start": { "line": 8, "column": 1, "offset": 296 }, "end": { "line": 9, "column": 1, "offset": 368 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Datatype.Vector3" } ], "position": { "start": { "line": 9, "column": 1, "offset": 368 }, "end": { "line": 9, "column": 19, "offset": 386 } } }, { "type": "text", "value": " should move the player relative to world coordinates\n(", "position": { "start": { "line": 9, "column": 19, "offset": 386 }, "end": { "line": 10, "column": 2, "offset": 441 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "false", "position": { "start": { "line": 10, "column": 3, "offset": 442 }, "end": { "line": 10, "column": 8, "offset": 447 } } } ], "position": { "start": { "line": 10, "column": 2, "offset": 441 }, "end": { "line": 10, "column": 9, "offset": 448 } } }, { "type": "text", "value": ") or the player's ", "position": { "start": { "line": 10, "column": 9, "offset": 448 }, "end": { "line": 10, "column": 27, "offset": 466 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Camera" } ], "position": { "start": { "line": 10, "column": 27, "offset": 466 }, "end": { "line": 10, "column": 41, "offset": 480 } } }, { "type": "text", "value": " (", "position": { "start": { "line": 10, "column": 41, "offset": 480 }, "end": { "line": 10, "column": 43, "offset": 482 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "true", "position": { "start": { "line": 10, "column": 44, "offset": 483 }, "end": { "line": 10, "column": 48, "offset": 487 } } } ], "position": { "start": { "line": 10, "column": 43, "offset": 482 }, "end": { "line": 10, "column": 49, "offset": 488 } } }, { "type": "text", "value": ").", "position": { "start": { "line": 10, "column": 49, "offset": 488 }, "end": { "line": 10, "column": 51, "offset": 490 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 296 }, "end": { "line": 10, "column": 51, "offset": 490 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-Move1", "displayName": "Moving the Player Towards Their Camera", "description": "The following example would cause the LocalPlayer to walk forward, towards\nwhere their camera is pointing.\n", "codeSample": "game.Players.LocalPlayer:Move(Vector3.new(0, 0, -1), true)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "walkDirection", "type": "Vector3", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The Vector3 direction that the player should move.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 51, "offset": 50 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 51, "offset": 50 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } }, { "name": "relativeToCamera", "type": "bool", "default": "false", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A boolean indicating whether the player should move relative to the\nplayer's camera.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 17, "offset": 84 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 17, "offset": 84 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:SaveBoolean", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Used to save a boolean value that can be loaded again at a later time\nusing ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 7, "offset": 76 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadBoolean()" } ], "position": { "start": { "line": 2, "column": 7, "offset": 76 }, "end": { "line": 2, "column": 35, "offset": 104 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 2, "column": 35, "offset": 104 }, "end": { "line": 2, "column": 36, "offset": 105 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 36, "offset": 105 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function is used to save a boolean value that can be loaded again at\na later time using ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 20, "offset": 93 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadBoolean()" } ], "position": { "start": { "line": 2, "column": 20, "offset": 93 }, "end": { "line": 2, "column": 48, "offset": 121 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 2, "column": 48, "offset": 121 }, "end": { "line": 2, "column": 49, "offset": 122 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 49, "offset": 122 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-SaveBoolean1", "displayName": "Player:SaveBoolean", "description": "The below example would save a boolean to the player with a key of \"HasPlayed\"\nand a value of true.\n", "codeSample": "game.Players.PlayerAdded:Connect(function(Player)\n\tif Player:WaitForDataReady() then\n\t\tPlayer:SaveBoolean(\"HasPlayed\", true)\n\tend\nend)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" }, { "name": "value", "type": "bool", "default": "null", "summary": "" } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated, as it may have been used for a now obsolete data\npersistence method. Please save and load player data using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 133 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataStoreService" } ], "position": { "start": { "line": 3, "column": 1, "offset": 133 }, "end": { "line": 3, "column": 25, "offset": 157 } } }, { "type": "text", "value": " for new work.", "position": { "start": { "line": 3, "column": 25, "offset": 157 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:SaveInstance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Saves an instance which can be loaded again at a later time.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 61, "offset": 60 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 61, "offset": 60 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function was once used by an ancient data persistence method to save\nan instance which can be loaded again at a later time using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 134 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadInstance()" } ], "position": { "start": { "line": 3, "column": 1, "offset": 134 }, "end": { "line": 3, "column": 30, "offset": 163 } } }, { "type": "text", "value": "..", "position": { "start": { "line": 3, "column": 30, "offset": 163 }, "end": { "line": 3, "column": 32, "offset": 165 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 32, "offset": 165 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-SaveInstance1", "displayName": "Player:SaveInstance", "description": "The below code will save 'Model', a descendant of Workspace, to the player\neach time they join the game. To access this instance again, we would need to\nindex it by it's key, 'Model', as defined in the first argument of this\nmethod.\n", "codeSample": "game.Players.PlayerAdded:Connect(function(Player)\n\tPlayer:WaitForDataReady()\n\tPlayer:SaveInstance(\"Model\", game.Workspace.Model)\nend)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" }, { "name": "value", "type": "Instance", "default": "null", "summary": "" } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated, as it may have been used for a now obsolete data\npersistence method. Please save and load player data using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 133 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataStoreService" } ], "position": { "start": { "line": 3, "column": 1, "offset": 133 }, "end": { "line": 3, "column": 25, "offset": 157 } } }, { "type": "text", "value": " for new work.", "position": { "start": { "line": 3, "column": 25, "offset": 157 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:SaveNumber", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Saves a number value that can be loaded again at a later time using.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 69, "offset": 68 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 69, "offset": 68 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function was once used by an ancient data persistence method to save\na number value that can be loaded again at a later time using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 136 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadNumber()" } ], "position": { "start": { "line": 3, "column": 1, "offset": 136 }, "end": { "line": 3, "column": 28, "offset": 163 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 3, "column": 28, "offset": 163 }, "end": { "line": 3, "column": 29, "offset": 164 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 29, "offset": 164 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-SaveNumber1", "displayName": "Player:SaveNumber", "description": "The below example would save a number to the player with a key of \"TotalPlays\"\nand add one to the value each time.\n", "codeSample": "game.Players.PlayerAdded:Connect(function(Player)\n\tif Player:WaitForDataReady() then\n\t\tlocal OldValue = Player:SaveNumber(\"TotalPlays\")\n\t\tPlayer:SaveNumber(\"TotalPlays\", OldValue + 1)\n\tend\nend)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" }, { "name": "value", "type": "double", "default": "null", "summary": "" } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated, as it may have been used for a now obsolete data\npersistence method. Please save and load player data using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 133 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataStoreService" } ], "position": { "start": { "line": 3, "column": 1, "offset": 133 }, "end": { "line": 3, "column": 25, "offset": 157 } } }, { "type": "text", "value": " for new work.", "position": { "start": { "line": 3, "column": 25, "offset": 157 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:SaveString", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Saves a string value that can be loaded again at a later time.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 63, "offset": 62 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 63, "offset": 62 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function was once used by an ancient data persistence method to save\na string value that can be loaded again at a later time using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 136 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadString()" } ], "position": { "start": { "line": 3, "column": 1, "offset": 136 }, "end": { "line": 3, "column": 28, "offset": 163 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 3, "column": 28, "offset": 163 }, "end": { "line": 3, "column": 29, "offset": 164 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 29, "offset": 164 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-SaveString1", "displayName": "Player:SaveString", "description": "The below example would save a string to the player with a key of \"TheirName\"\nand a value of their current name. If you printed it, it would print their\nname.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n\tif player:WaitForDataReady() then\n\t\tplayer:SaveString(\"TheirName\", player.Name)\n\tend\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" }, { "name": "value", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated, as it may have been used for a now obsolete data\npersistence method. Please save and load player data using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 133 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataStoreService" } ], "position": { "start": { "line": 3, "column": 1, "offset": 133 }, "end": { "line": 3, "column": 25, "offset": 157 } } }, { "type": "text", "value": " for new work.", "position": { "start": { "line": 3, "column": 25, "offset": 157 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:SetAccountAge", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Sets the AccountAge of the player.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 35, "offset": 34 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 35, "offset": 34 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The SetAccountAge function sets the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 37, "offset": 36 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.AccountAge" } ], "position": { "start": { "line": 1, "column": 37, "offset": 36 }, "end": { "line": 1, "column": 62, "offset": 61 } } }, { "type": "text", "value": " of the\nplayer in days.", "position": { "start": { "line": 1, "column": 62, "offset": 61 }, "end": { "line": 2, "column": 16, "offset": 84 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 16, "offset": 84 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "It is used to set the ", "position": { "start": { "line": 4, "column": 1, "offset": 86 }, "end": { "line": 4, "column": 23, "offset": 108 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 4, "column": 23, "offset": 108 }, "end": { "line": 4, "column": 37, "offset": 122 } } }, { "type": "text", "value": " property that describes how long ago\na player's account was registered in days.", "position": { "start": { "line": 4, "column": 37, "offset": 122 }, "end": { "line": 5, "column": 43, "offset": 202 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 86 }, "end": { "line": 5, "column": 43, "offset": 202 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This does not set the age of the player on the account, but the age of the\naccount itself relative to when it was first created.", "position": { "start": { "line": 7, "column": 1, "offset": 204 }, "end": { "line": 8, "column": 54, "offset": 332 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 204 }, "end": { "line": 8, "column": 54, "offset": 332 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "setting-the-player-s-account-age", "displayName": "Setting the Player's Account Age", "description": "This example demonstrates how the `Class.Player:SetAccountAge()` function\nwould be used if it was accessible. It sets the local player's account age to\n100 days.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nplayer:SetAccountAge(100)", "expectedOutput": "", "highlightLines": "" }, { "identifier": "Account-Age-Mark", "displayName": "Account Age Mark", "description": "This code sample adds a mark to players showing about how old their account\nis. The mark uses a player's account age to determine if they are a New\nPlayer, Veteran Player or Regular Player.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal MAX_AGE_NEW_PLAYER = 7 -- one week\nlocal MIN_AGE_VETERAN = 365 -- one year\n\n-- This function marks a part with text using a BillboardGui\nlocal function mark(part, text)\n\tlocal bbgui = Instance.new(\"BillboardGui\")\n\tbbgui.AlwaysOnTop = true\n\tbbgui.StudsOffsetWorldSpace = Vector3.new(0, 2, 0)\n\tbbgui.Size = UDim2.new(0, 200, 0, 50)\n\tlocal textLabel = Instance.new(\"TextLabel\")\n\ttextLabel.Size = UDim2.new(1, 0, 1, 0) -- Fill parent\n\ttextLabel.Text = text\n\ttextLabel.TextColor3 = Color3.new(1, 1, 1)\n\ttextLabel.TextStrokeTransparency = 0\n\ttextLabel.BackgroundTransparency = 1\n\ttextLabel.Parent = bbgui\n\t-- Add to part\n\tbbgui.Parent = part\n\tbbgui.Adornee = part\nend\n\nlocal function onPlayerSpawned(player, character)\n\tlocal head = character:WaitForChild(\"Head\")\n\tif player.AccountAge >= MIN_AGE_VETERAN then\n\t\tmark(head, \"Veteran Player\")\n\telseif player.AccountAge <= MAX_AGE_NEW_PLAYER then\n\t\tmark(head, \"New Player\")\n\telse\n\t\tmark(head, \"Regular Player\")\n\tend\nend\n\nlocal function onPlayerAdded(player)\n\t-- Listen for this player spawning\n\tif player.Character then\n\t\tonPlayerSpawned(player, player.Character)\n\tend\n\tplayer.CharacterAdded:Connect(function()\n\t\tonPlayerSpawned(player, player.Character)\n\tend)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "accountAge", "type": "int", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The age of the account in days.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "PLUGIN_SECURITY" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:SetSuperSafeChat", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Sets whether or not the player sees filtered chats, rather than normal\nchats.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 7, "offset": 77 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 7, "offset": 77 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The SetSuperSafeChat ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 22, "offset": 21 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 22, "offset": 21 }, "end": { "line": 1, "column": 36, "offset": 35 } } }, { "type": "text", "value": " function sets whether or not the\nplayer sees chat filtered by ", "position": { "start": { "line": 1, "column": 36, "offset": 35 }, "end": { "line": 2, "column": 30, "offset": 98 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.TextService" } ], "position": { "start": { "line": 2, "column": 30, "offset": 98 }, "end": { "line": 2, "column": 49, "offset": 117 } } }, { "type": "text", "value": "'s\n", "position": { "start": { "line": 2, "column": 49, "offset": 117 }, "end": { "line": 3, "column": 1, "offset": 120 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.TextService:FilterStringAsync()" } ], "position": { "start": { "line": 3, "column": 1, "offset": 120 }, "end": { "line": 3, "column": 40, "offset": 159 } } }, { "type": "text", "value": " rather than normal chats.", "position": { "start": { "line": 3, "column": 40, "offset": 159 }, "end": { "line": 3, "column": 66, "offset": 185 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 66, "offset": 185 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "SuperSafeChat is a chat mode where players cannot see unfiltered messages.", "position": { "start": { "line": 5, "column": 1, "offset": 187 }, "end": { "line": 5, "column": 75, "offset": 261 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 187 }, "end": { "line": 5, "column": 75, "offset": 261 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "For example, entering the following command in the command prompt would\nenable SuperSafeChat for the player named polarpanda16, as long as that\nplayer is in the game:", "position": { "start": { "line": 7, "column": 1, "offset": 263 }, "end": { "line": 9, "column": 23, "offset": 429 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 263 }, "end": { "line": 9, "column": 23, "offset": 429 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "img", "properties": { "src": "/assets/legacy/Screen_Shot_2018-07-28_at_9.46.09_PM.png", "alt": "Command prompt example enabling SuperSafeChat" }, "children": [], "position": { "start": { "line": 11, "column": 1, "offset": 431 }, "end": { "line": 11, "column": 106, "offset": 536 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 431 }, "end": { "line": 11, "column": 106, "offset": 536 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Regardless of whether a player has SuperSafeChat enabled, all chat should\nbe filtered by TextService when broadcasted to other players or on the\nplayer's own screen. ", "position": { "start": { "line": 13, "column": 1, "offset": 538 }, "end": { "line": 15, "column": 22, "offset": 704 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.TextService:FilterStringAsync()" } ], "position": { "start": { "line": 15, "column": 22, "offset": 704 }, "end": { "line": 15, "column": 61, "offset": 743 } } }, { "type": "text", "value": " returns a\n", "position": { "start": { "line": 15, "column": 61, "offset": 743 }, "end": { "line": 16, "column": 1, "offset": 754 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.TextFilterResult" } ], "position": { "start": { "line": 16, "column": 1, "offset": 754 }, "end": { "line": 16, "column": 25, "offset": 778 } } }, { "type": "text", "value": " object that can be filtered differently according\nto the message's intended use.", "position": { "start": { "line": 16, "column": 25, "offset": 778 }, "end": { "line": 17, "column": 31, "offset": 859 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 538 }, "end": { "line": 17, "column": 31, "offset": 859 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "value", "type": "bool", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A boolean indicating whether or not the player sees filtered chat.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 67, "offset": 66 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 67, "offset": 66 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "PLUGIN_SECURITY" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:loadBoolean", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "bool", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated function is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadBoolean()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 70, "offset": 69 } } }, { "type": "text", "value": "\nwhich has also been deprecated. Neither function should be used in new\nwork.", "position": { "start": { "line": 1, "column": 70, "offset": 69 }, "end": { "line": 3, "column": 6, "offset": 146 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 6, "offset": 146 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:loadInstance", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "Instance", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated function is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadInstance()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 71, "offset": 70 } } }, { "type": "text", "value": "\nwhich has also been deprecated. Neither function should be used in new\nwork.", "position": { "start": { "line": 1, "column": 71, "offset": 70 }, "end": { "line": 3, "column": 6, "offset": 147 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 6, "offset": 147 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:loadNumber", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "double", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated function is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadNumber()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 69, "offset": 68 } } }, { "type": "text", "value": " which\nhas also been deprecated. Neither function should be used in new work.", "position": { "start": { "line": 1, "column": 69, "offset": 68 }, "end": { "line": 2, "column": 71, "offset": 145 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 71, "offset": 145 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:loadString", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "string", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function is a deprecated variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadString()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 69, "offset": 68 } } }, { "type": "text", "value": " which\nhas also been deprecated. Neither function should be used in new work.", "position": { "start": { "line": 1, "column": 69, "offset": 68 }, "end": { "line": 2, "column": 71, "offset": 145 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 71, "offset": 145 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:saveBoolean", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" }, { "name": "value", "type": "bool", "default": "null", "summary": "" } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function is a deprecated variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:SaveBoolean()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 70, "offset": 69 } } }, { "type": "text", "value": "\nwhich has also been deprecated. Neither function should be used in new\nwork.", "position": { "start": { "line": 1, "column": 70, "offset": 69 }, "end": { "line": 3, "column": 6, "offset": 146 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 6, "offset": 146 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:saveInstance", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" }, { "name": "value", "type": "Instance", "default": "null", "summary": "" } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function is a deprecated variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:SaveInstance()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 71, "offset": 70 } } }, { "type": "text", "value": "\nwhich has also been deprecated. Neither function should be used in new\nwork.", "position": { "start": { "line": 1, "column": 71, "offset": 70 }, "end": { "line": 3, "column": 6, "offset": 147 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 6, "offset": 147 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:saveNumber", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" }, { "name": "value", "type": "double", "default": "null", "summary": "" } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function is a deprecated variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:SaveNumber()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 69, "offset": 68 } } }, { "type": "text", "value": " which\nhas also been deprecated. Neither function should be used in new work.", "position": { "start": { "line": 1, "column": 69, "offset": 68 }, "end": { "line": 2, "column": 71, "offset": 145 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 71, "offset": 145 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:saveString", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "key", "type": "string", "default": "null", "summary": "" }, { "name": "value", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function is a deprecated variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:SaveString()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 69, "offset": 68 } } }, { "type": "text", "value": " which\nhas also been deprecated. Neither function should be used in new work.", "position": { "start": { "line": 1, "column": 69, "offset": 68 }, "end": { "line": 2, "column": 71, "offset": 145 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 71, "offset": 145 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:GetFriendsOnline", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns a dictionary of online friends.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 40, "offset": 39 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 40, "offset": 39 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function returns a dictionary array of online friends, limited by the\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 75 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "maxFriends" } ], "position": { "start": { "line": 2, "column": 1, "offset": 75 }, "end": { "line": 2, "column": 13, "offset": 87 } } }, { "type": "text", "value": " value. The function uses a 30 second cache.", "position": { "start": { "line": 2, "column": 13, "offset": 87 }, "end": { "line": 2, "column": 57, "offset": 131 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 57, "offset": 131 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "In the returned array, some fields are only present for certain location\ntypes. For example, ", "position": { "start": { "line": 4, "column": 1, "offset": 133 }, "end": { "line": 5, "column": 21, "offset": 226 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "PlaceId", "position": { "start": { "line": 5, "column": 23, "offset": 228 }, "end": { "line": 5, "column": 30, "offset": 235 } } } ], "position": { "start": { "line": 5, "column": 21, "offset": 226 }, "end": { "line": 5, "column": 32, "offset": 237 } } }, { "type": "text", "value": " won't be present when ", "position": { "start": { "line": 5, "column": 32, "offset": 237 }, "end": { "line": 5, "column": 55, "offset": 260 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "LocationType", "position": { "start": { "line": 5, "column": 57, "offset": 262 }, "end": { "line": 5, "column": 69, "offset": 274 } } } ], "position": { "start": { "line": 5, "column": 55, "offset": 260 }, "end": { "line": 5, "column": 71, "offset": 276 } } }, { "type": "text", "value": " is\n0 (Mobile Website).", "position": { "start": { "line": 5, "column": 71, "offset": 276 }, "end": { "line": 6, "column": 20, "offset": 299 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 133 }, "end": { "line": 6, "column": 20, "offset": 299 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "table", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 8, "column": 8, "offset": 308 }, "end": { "line": 9, "column": 5, "offset": 313 } } }, { "type": "element", "tagName": "thead", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 9, "column": 12, "offset": 320 }, "end": { "line": 10, "column": 9, "offset": 329 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 10, "column": 13, "offset": 333 }, "end": { "line": 11, "column": 13, "offset": 346 } } }, { "type": "element", "tagName": "th", "properties": {}, "children": [ { "type": "text", "value": "Name", "position": { "start": { "line": 11, "column": 17, "offset": 350 }, "end": { "line": 11, "column": 21, "offset": 354 } } } ], "position": { "start": { "line": 11, "column": 13, "offset": 346 }, "end": { "line": 11, "column": 26, "offset": 359 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 11, "column": 26, "offset": 359 }, "end": { "line": 12, "column": 13, "offset": 372 } } }, { "type": "element", "tagName": "th", "properties": {}, "children": [ { "type": "text", "value": "Type", "position": { "start": { "line": 12, "column": 17, "offset": 376 }, "end": { "line": 12, "column": 21, "offset": 380 } } } ], "position": { "start": { "line": 12, "column": 13, "offset": 372 }, "end": { "line": 12, "column": 26, "offset": 385 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 12, "column": 26, "offset": 385 }, "end": { "line": 13, "column": 13, "offset": 398 } } }, { "type": "element", "tagName": "th", "properties": {}, "children": [ { "type": "text", "value": "Description", "position": { "start": { "line": 13, "column": 17, "offset": 402 }, "end": { "line": 13, "column": 28, "offset": 413 } } } ], "position": { "start": { "line": 13, "column": 13, "offset": 398 }, "end": { "line": 13, "column": 33, "offset": 418 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 13, "column": 33, "offset": 418 }, "end": { "line": 14, "column": 9, "offset": 427 } } } ], "position": { "start": { "line": 10, "column": 9, "offset": 329 }, "end": { "line": 14, "column": 14, "offset": 432 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 14, "column": 14, "offset": 432 }, "end": { "line": 15, "column": 5, "offset": 437 } } } ], "position": { "start": { "line": 9, "column": 5, "offset": 313 }, "end": { "line": 15, "column": 13, "offset": 445 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 15, "column": 13, "offset": 445 }, "end": { "line": 16, "column": 5, "offset": 450 } } }, { "type": "element", "tagName": "tbody", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 16, "column": 12, "offset": 457 }, "end": { "line": 17, "column": 9, "offset": 466 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 17, "column": 13, "offset": 470 }, "end": { "line": 18, "column": 13, "offset": 483 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "VisitorId", "position": { "start": { "line": 18, "column": 20, "offset": 490 }, "end": { "line": 18, "column": 29, "offset": 499 } } } ], "position": { "start": { "line": 18, "column": 17, "offset": 487 }, "end": { "line": 18, "column": 33, "offset": 503 } } } ], "position": { "start": { "line": 18, "column": 13, "offset": 483 }, "end": { "line": 18, "column": 38, "offset": 508 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 18, "column": 38, "offset": 508 }, "end": { "line": 19, "column": 13, "offset": 521 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "number", "position": { "start": { "line": 19, "column": 17, "offset": 525 }, "end": { "line": 19, "column": 23, "offset": 531 } } } ], "position": { "start": { "line": 19, "column": 13, "offset": 521 }, "end": { "line": 19, "column": 28, "offset": 536 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 19, "column": 28, "offset": 536 }, "end": { "line": 20, "column": 13, "offset": 549 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 20, "column": 17, "offset": 553 }, "end": { "line": 20, "column": 21, "offset": 557 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.UserId", "position": { "start": { "line": 20, "column": 27, "offset": 563 }, "end": { "line": 20, "column": 46, "offset": 582 } } } ], "position": { "start": { "line": 20, "column": 21, "offset": 557 }, "end": { "line": 20, "column": 53, "offset": 589 } } }, { "type": "text", "value": " of the friend.", "position": { "start": { "line": 20, "column": 53, "offset": 589 }, "end": { "line": 20, "column": 68, "offset": 604 } } } ], "position": { "start": { "line": 20, "column": 13, "offset": 549 }, "end": { "line": 20, "column": 73, "offset": 609 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 20, "column": 73, "offset": 609 }, "end": { "line": 21, "column": 9, "offset": 618 } } } ], "position": { "start": { "line": 17, "column": 9, "offset": 466 }, "end": { "line": 21, "column": 14, "offset": 623 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 21, "column": 14, "offset": 623 }, "end": { "line": 22, "column": 9, "offset": 632 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 22, "column": 13, "offset": 636 }, "end": { "line": 23, "column": 13, "offset": 649 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "UserName", "position": { "start": { "line": 23, "column": 20, "offset": 656 }, "end": { "line": 23, "column": 28, "offset": 664 } } } ], "position": { "start": { "line": 23, "column": 17, "offset": 653 }, "end": { "line": 23, "column": 32, "offset": 668 } } } ], "position": { "start": { "line": 23, "column": 13, "offset": 649 }, "end": { "line": 23, "column": 37, "offset": 673 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 23, "column": 37, "offset": 673 }, "end": { "line": 24, "column": 13, "offset": 686 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "string", "position": { "start": { "line": 24, "column": 17, "offset": 690 }, "end": { "line": 24, "column": 23, "offset": 696 } } } ], "position": { "start": { "line": 24, "column": 13, "offset": 686 }, "end": { "line": 24, "column": 28, "offset": 701 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 24, "column": 28, "offset": 701 }, "end": { "line": 25, "column": 13, "offset": 714 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "The username of the friend.", "position": { "start": { "line": 25, "column": 17, "offset": 718 }, "end": { "line": 25, "column": 44, "offset": 745 } } } ], "position": { "start": { "line": 25, "column": 13, "offset": 714 }, "end": { "line": 25, "column": 49, "offset": 750 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 25, "column": 49, "offset": 750 }, "end": { "line": 26, "column": 9, "offset": 759 } } } ], "position": { "start": { "line": 22, "column": 9, "offset": 632 }, "end": { "line": 26, "column": 14, "offset": 764 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 26, "column": 14, "offset": 764 }, "end": { "line": 27, "column": 9, "offset": 773 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 27, "column": 13, "offset": 777 }, "end": { "line": 28, "column": 13, "offset": 790 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "DisplayName", "position": { "start": { "line": 28, "column": 20, "offset": 797 }, "end": { "line": 28, "column": 31, "offset": 808 } } } ], "position": { "start": { "line": 28, "column": 17, "offset": 794 }, "end": { "line": 28, "column": 35, "offset": 812 } } } ], "position": { "start": { "line": 28, "column": 13, "offset": 790 }, "end": { "line": 28, "column": 40, "offset": 817 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 28, "column": 40, "offset": 817 }, "end": { "line": 29, "column": 13, "offset": 830 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "string", "position": { "start": { "line": 29, "column": 17, "offset": 834 }, "end": { "line": 29, "column": 23, "offset": 840 } } } ], "position": { "start": { "line": 29, "column": 13, "offset": 830 }, "end": { "line": 29, "column": 28, "offset": 845 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 29, "column": 28, "offset": 845 }, "end": { "line": 30, "column": 13, "offset": 858 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 30, "column": 17, "offset": 862 }, "end": { "line": 30, "column": 21, "offset": 866 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.DisplayName", "position": { "start": { "line": 30, "column": 27, "offset": 872 }, "end": { "line": 30, "column": 51, "offset": 896 } } } ], "position": { "start": { "line": 30, "column": 21, "offset": 866 }, "end": { "line": 30, "column": 58, "offset": 903 } } }, { "type": "text", "value": " of the friend.", "position": { "start": { "line": 30, "column": 58, "offset": 903 }, "end": { "line": 30, "column": 73, "offset": 918 } } } ], "position": { "start": { "line": 30, "column": 13, "offset": 858 }, "end": { "line": 30, "column": 78, "offset": 923 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 30, "column": 78, "offset": 923 }, "end": { "line": 31, "column": 9, "offset": 932 } } } ], "position": { "start": { "line": 27, "column": 9, "offset": 773 }, "end": { "line": 31, "column": 14, "offset": 937 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 31, "column": 14, "offset": 937 }, "end": { "line": 32, "column": 9, "offset": 946 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 32, "column": 13, "offset": 950 }, "end": { "line": 33, "column": 13, "offset": 963 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "LastOnline", "position": { "start": { "line": 33, "column": 20, "offset": 970 }, "end": { "line": 33, "column": 30, "offset": 980 } } } ], "position": { "start": { "line": 33, "column": 17, "offset": 967 }, "end": { "line": 33, "column": 34, "offset": 984 } } } ], "position": { "start": { "line": 33, "column": 13, "offset": 963 }, "end": { "line": 33, "column": 39, "offset": 989 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 33, "column": 39, "offset": 989 }, "end": { "line": 34, "column": 13, "offset": 1002 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "string", "position": { "start": { "line": 34, "column": 17, "offset": 1006 }, "end": { "line": 34, "column": 23, "offset": 1012 } } } ], "position": { "start": { "line": 34, "column": 13, "offset": 1002 }, "end": { "line": 34, "column": 28, "offset": 1017 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 34, "column": 28, "offset": 1017 }, "end": { "line": 35, "column": 13, "offset": 1030 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "When the friend was last online.", "position": { "start": { "line": 35, "column": 17, "offset": 1034 }, "end": { "line": 35, "column": 49, "offset": 1066 } } } ], "position": { "start": { "line": 35, "column": 13, "offset": 1030 }, "end": { "line": 35, "column": 54, "offset": 1071 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 35, "column": 54, "offset": 1071 }, "end": { "line": 36, "column": 9, "offset": 1080 } } } ], "position": { "start": { "line": 32, "column": 9, "offset": 946 }, "end": { "line": 36, "column": 14, "offset": 1085 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 36, "column": 14, "offset": 1085 }, "end": { "line": 37, "column": 9, "offset": 1094 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 37, "column": 13, "offset": 1098 }, "end": { "line": 38, "column": 13, "offset": 1111 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "IsOnline", "position": { "start": { "line": 38, "column": 20, "offset": 1118 }, "end": { "line": 38, "column": 28, "offset": 1126 } } } ], "position": { "start": { "line": 38, "column": 17, "offset": 1115 }, "end": { "line": 38, "column": 32, "offset": 1130 } } } ], "position": { "start": { "line": 38, "column": 13, "offset": 1111 }, "end": { "line": 38, "column": 37, "offset": 1135 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 38, "column": 37, "offset": 1135 }, "end": { "line": 39, "column": 13, "offset": 1148 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "boolean", "position": { "start": { "line": 39, "column": 17, "offset": 1152 }, "end": { "line": 39, "column": 24, "offset": 1159 } } } ], "position": { "start": { "line": 39, "column": 13, "offset": 1148 }, "end": { "line": 39, "column": 29, "offset": 1164 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 39, "column": 29, "offset": 1164 }, "end": { "line": 40, "column": 13, "offset": 1177 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "If the friend is currently online.", "position": { "start": { "line": 40, "column": 17, "offset": 1181 }, "end": { "line": 40, "column": 51, "offset": 1215 } } } ], "position": { "start": { "line": 40, "column": 13, "offset": 1177 }, "end": { "line": 40, "column": 56, "offset": 1220 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 40, "column": 56, "offset": 1220 }, "end": { "line": 41, "column": 9, "offset": 1229 } } } ], "position": { "start": { "line": 37, "column": 9, "offset": 1094 }, "end": { "line": 41, "column": 14, "offset": 1234 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 41, "column": 14, "offset": 1234 }, "end": { "line": 42, "column": 9, "offset": 1243 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 42, "column": 13, "offset": 1247 }, "end": { "line": 43, "column": 13, "offset": 1260 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "LastLocation", "position": { "start": { "line": 43, "column": 20, "offset": 1267 }, "end": { "line": 43, "column": 32, "offset": 1279 } } } ], "position": { "start": { "line": 43, "column": 17, "offset": 1264 }, "end": { "line": 43, "column": 36, "offset": 1283 } } } ], "position": { "start": { "line": 43, "column": 13, "offset": 1260 }, "end": { "line": 43, "column": 41, "offset": 1288 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 43, "column": 41, "offset": 1288 }, "end": { "line": 44, "column": 13, "offset": 1301 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "string", "position": { "start": { "line": 44, "column": 17, "offset": 1305 }, "end": { "line": 44, "column": 23, "offset": 1311 } } } ], "position": { "start": { "line": 44, "column": 13, "offset": 1301 }, "end": { "line": 44, "column": 28, "offset": 1316 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 44, "column": 28, "offset": 1316 }, "end": { "line": 45, "column": 13, "offset": 1329 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "The name of the friend's current location.", "position": { "start": { "line": 45, "column": 17, "offset": 1333 }, "end": { "line": 45, "column": 59, "offset": 1375 } } } ], "position": { "start": { "line": 45, "column": 13, "offset": 1329 }, "end": { "line": 45, "column": 64, "offset": 1380 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 45, "column": 64, "offset": 1380 }, "end": { "line": 46, "column": 9, "offset": 1389 } } } ], "position": { "start": { "line": 42, "column": 9, "offset": 1243 }, "end": { "line": 46, "column": 14, "offset": 1394 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 46, "column": 14, "offset": 1394 }, "end": { "line": 47, "column": 9, "offset": 1403 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 47, "column": 13, "offset": 1407 }, "end": { "line": 48, "column": 13, "offset": 1420 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "PlaceId", "position": { "start": { "line": 48, "column": 20, "offset": 1427 }, "end": { "line": 48, "column": 27, "offset": 1434 } } } ], "position": { "start": { "line": 48, "column": 17, "offset": 1424 }, "end": { "line": 48, "column": 31, "offset": 1438 } } } ], "position": { "start": { "line": 48, "column": 13, "offset": 1420 }, "end": { "line": 48, "column": 36, "offset": 1443 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 48, "column": 36, "offset": 1443 }, "end": { "line": 49, "column": 13, "offset": 1456 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "number", "position": { "start": { "line": 49, "column": 17, "offset": 1460 }, "end": { "line": 49, "column": 23, "offset": 1466 } } } ], "position": { "start": { "line": 49, "column": 13, "offset": 1456 }, "end": { "line": 49, "column": 28, "offset": 1471 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 49, "column": 28, "offset": 1471 }, "end": { "line": 50, "column": 13, "offset": 1484 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "The place ID of the friend's last location.", "position": { "start": { "line": 50, "column": 17, "offset": 1488 }, "end": { "line": 50, "column": 60, "offset": 1531 } } } ], "position": { "start": { "line": 50, "column": 13, "offset": 1484 }, "end": { "line": 50, "column": 65, "offset": 1536 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 50, "column": 65, "offset": 1536 }, "end": { "line": 51, "column": 9, "offset": 1545 } } } ], "position": { "start": { "line": 47, "column": 9, "offset": 1403 }, "end": { "line": 51, "column": 14, "offset": 1550 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 51, "column": 14, "offset": 1550 }, "end": { "line": 52, "column": 9, "offset": 1559 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 52, "column": 13, "offset": 1563 }, "end": { "line": 53, "column": 13, "offset": 1576 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "GameId", "position": { "start": { "line": 53, "column": 20, "offset": 1583 }, "end": { "line": 53, "column": 26, "offset": 1589 } } } ], "position": { "start": { "line": 53, "column": 17, "offset": 1580 }, "end": { "line": 53, "column": 30, "offset": 1593 } } } ], "position": { "start": { "line": 53, "column": 13, "offset": 1576 }, "end": { "line": 53, "column": 35, "offset": 1598 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 53, "column": 35, "offset": 1598 }, "end": { "line": 54, "column": 13, "offset": 1611 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "string", "position": { "start": { "line": 54, "column": 17, "offset": 1615 }, "end": { "line": 54, "column": 23, "offset": 1621 } } } ], "position": { "start": { "line": 54, "column": 13, "offset": 1611 }, "end": { "line": 54, "column": 28, "offset": 1626 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 54, "column": 28, "offset": 1626 }, "end": { "line": 55, "column": 13, "offset": 1639 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 55, "column": 17, "offset": 1643 }, "end": { "line": 55, "column": 21, "offset": 1647 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "DataModel/JobId", "position": { "start": { "line": 55, "column": 27, "offset": 1653 }, "end": { "line": 55, "column": 42, "offset": 1668 } } } ], "position": { "start": { "line": 55, "column": 21, "offset": 1647 }, "end": { "line": 55, "column": 49, "offset": 1675 } } }, { "type": "text", "value": " of the friend's last location.", "position": { "start": { "line": 55, "column": 49, "offset": 1675 }, "end": { "line": 55, "column": 80, "offset": 1706 } } } ], "position": { "start": { "line": 55, "column": 13, "offset": 1639 }, "end": { "line": 55, "column": 85, "offset": 1711 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 55, "column": 85, "offset": 1711 }, "end": { "line": 56, "column": 9, "offset": 1720 } } } ], "position": { "start": { "line": 52, "column": 9, "offset": 1559 }, "end": { "line": 56, "column": 14, "offset": 1725 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 56, "column": 14, "offset": 1725 }, "end": { "line": 57, "column": 9, "offset": 1734 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 57, "column": 13, "offset": 1738 }, "end": { "line": 58, "column": 13, "offset": 1751 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "LocationType", "position": { "start": { "line": 58, "column": 20, "offset": 1758 }, "end": { "line": 58, "column": 32, "offset": 1770 } } } ], "position": { "start": { "line": 58, "column": 17, "offset": 1755 }, "end": { "line": 58, "column": 36, "offset": 1774 } } } ], "position": { "start": { "line": 58, "column": 13, "offset": 1751 }, "end": { "line": 58, "column": 41, "offset": 1779 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 58, "column": 41, "offset": 1779 }, "end": { "line": 59, "column": 13, "offset": 1792 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "number", "position": { "start": { "line": 59, "column": 17, "offset": 1796 }, "end": { "line": 59, "column": 23, "offset": 1802 } } } ], "position": { "start": { "line": 59, "column": 13, "offset": 1792 }, "end": { "line": 59, "column": 28, "offset": 1807 } } }, { "type": "text", "value": "\n", "position": { "start": { "line": 59, "column": 28, "offset": 1807 }, "end": { "line": 60, "column": 1, "offset": 1808 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "\nThe location type of the friend's last location:\n", "position": { "start": { "line": 60, "column": 5, "offset": 1812 }, "end": { "line": 62, "column": 1, "offset": 1862 } } }, { "type": "element", "tagName": "table", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 62, "column": 8, "offset": 1869 }, "end": { "line": 63, "column": 5, "offset": 1874 } } }, { "type": "element", "tagName": "tbody", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 63, "column": 12, "offset": 1881 }, "end": { "line": 64, "column": 9, "offset": 1890 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 64, "column": 13, "offset": 1894 }, "end": { "line": 65, "column": 13, "offset": 1907 } } }, { "type": "element", "tagName": "td", "properties": { "style": "width: 20%;" }, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "0", "position": { "start": { "line": 65, "column": 32, "offset": 1926 }, "end": { "line": 65, "column": 33, "offset": 1927 } } } ], "position": { "start": { "line": 65, "column": 29, "offset": 1923 }, "end": { "line": 65, "column": 37, "offset": 1931 } } } ], "position": { "start": { "line": 65, "column": 13, "offset": 1907 }, "end": { "line": 65, "column": 42, "offset": 1936 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 65, "column": 42, "offset": 1936 }, "end": { "line": 66, "column": 13, "offset": 1949 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "Mobile Website", "position": { "start": { "line": 66, "column": 17, "offset": 1953 }, "end": { "line": 66, "column": 31, "offset": 1967 } } } ], "position": { "start": { "line": 66, "column": 13, "offset": 1949 }, "end": { "line": 66, "column": 36, "offset": 1972 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 66, "column": 36, "offset": 1972 }, "end": { "line": 67, "column": 9, "offset": 1981 } } } ], "position": { "start": { "line": 64, "column": 9, "offset": 1890 }, "end": { "line": 67, "column": 14, "offset": 1986 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 67, "column": 14, "offset": 1986 }, "end": { "line": 68, "column": 9, "offset": 1995 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 68, "column": 13, "offset": 1999 }, "end": { "line": 69, "column": 13, "offset": 2012 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "1", "position": { "start": { "line": 69, "column": 20, "offset": 2019 }, "end": { "line": 69, "column": 21, "offset": 2020 } } } ], "position": { "start": { "line": 69, "column": 17, "offset": 2016 }, "end": { "line": 69, "column": 25, "offset": 2024 } } } ], "position": { "start": { "line": 69, "column": 13, "offset": 2012 }, "end": { "line": 69, "column": 30, "offset": 2029 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 69, "column": 30, "offset": 2029 }, "end": { "line": 70, "column": 13, "offset": 2042 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "Mobile InGame", "position": { "start": { "line": 70, "column": 17, "offset": 2046 }, "end": { "line": 70, "column": 30, "offset": 2059 } } } ], "position": { "start": { "line": 70, "column": 13, "offset": 2042 }, "end": { "line": 70, "column": 35, "offset": 2064 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 70, "column": 35, "offset": 2064 }, "end": { "line": 71, "column": 9, "offset": 2073 } } } ], "position": { "start": { "line": 68, "column": 9, "offset": 1995 }, "end": { "line": 71, "column": 14, "offset": 2078 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 71, "column": 14, "offset": 2078 }, "end": { "line": 72, "column": 9, "offset": 2087 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 72, "column": 13, "offset": 2091 }, "end": { "line": 73, "column": 13, "offset": 2104 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "2", "position": { "start": { "line": 73, "column": 20, "offset": 2111 }, "end": { "line": 73, "column": 21, "offset": 2112 } } } ], "position": { "start": { "line": 73, "column": 17, "offset": 2108 }, "end": { "line": 73, "column": 25, "offset": 2116 } } } ], "position": { "start": { "line": 73, "column": 13, "offset": 2104 }, "end": { "line": 73, "column": 30, "offset": 2121 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 73, "column": 30, "offset": 2121 }, "end": { "line": 74, "column": 13, "offset": 2134 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "Webpage", "position": { "start": { "line": 74, "column": 17, "offset": 2138 }, "end": { "line": 74, "column": 24, "offset": 2145 } } } ], "position": { "start": { "line": 74, "column": 13, "offset": 2134 }, "end": { "line": 74, "column": 29, "offset": 2150 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 74, "column": 29, "offset": 2150 }, "end": { "line": 75, "column": 9, "offset": 2159 } } } ], "position": { "start": { "line": 72, "column": 9, "offset": 2087 }, "end": { "line": 75, "column": 14, "offset": 2164 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 75, "column": 14, "offset": 2164 }, "end": { "line": 76, "column": 9, "offset": 2173 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 76, "column": 13, "offset": 2177 }, "end": { "line": 77, "column": 13, "offset": 2190 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "3", "position": { "start": { "line": 77, "column": 20, "offset": 2197 }, "end": { "line": 77, "column": 21, "offset": 2198 } } } ], "position": { "start": { "line": 77, "column": 17, "offset": 2194 }, "end": { "line": 77, "column": 25, "offset": 2202 } } } ], "position": { "start": { "line": 77, "column": 13, "offset": 2190 }, "end": { "line": 77, "column": 30, "offset": 2207 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 77, "column": 30, "offset": 2207 }, "end": { "line": 78, "column": 13, "offset": 2220 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "Studio", "position": { "start": { "line": 78, "column": 17, "offset": 2224 }, "end": { "line": 78, "column": 23, "offset": 2230 } } } ], "position": { "start": { "line": 78, "column": 13, "offset": 2220 }, "end": { "line": 78, "column": 28, "offset": 2235 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 78, "column": 28, "offset": 2235 }, "end": { "line": 79, "column": 9, "offset": 2244 } } } ], "position": { "start": { "line": 76, "column": 9, "offset": 2173 }, "end": { "line": 79, "column": 14, "offset": 2249 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 79, "column": 14, "offset": 2249 }, "end": { "line": 80, "column": 9, "offset": 2258 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 80, "column": 13, "offset": 2262 }, "end": { "line": 81, "column": 13, "offset": 2275 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "4", "position": { "start": { "line": 81, "column": 20, "offset": 2282 }, "end": { "line": 81, "column": 21, "offset": 2283 } } } ], "position": { "start": { "line": 81, "column": 17, "offset": 2279 }, "end": { "line": 81, "column": 25, "offset": 2287 } } } ], "position": { "start": { "line": 81, "column": 13, "offset": 2275 }, "end": { "line": 81, "column": 30, "offset": 2292 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 81, "column": 30, "offset": 2292 }, "end": { "line": 82, "column": 13, "offset": 2305 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "InGame", "position": { "start": { "line": 82, "column": 17, "offset": 2309 }, "end": { "line": 82, "column": 23, "offset": 2315 } } } ], "position": { "start": { "line": 82, "column": 13, "offset": 2305 }, "end": { "line": 82, "column": 28, "offset": 2320 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 82, "column": 28, "offset": 2320 }, "end": { "line": 83, "column": 9, "offset": 2329 } } } ], "position": { "start": { "line": 80, "column": 9, "offset": 2258 }, "end": { "line": 83, "column": 14, "offset": 2334 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 83, "column": 14, "offset": 2334 }, "end": { "line": 84, "column": 9, "offset": 2343 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 84, "column": 13, "offset": 2347 }, "end": { "line": 85, "column": 13, "offset": 2360 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "5", "position": { "start": { "line": 85, "column": 20, "offset": 2367 }, "end": { "line": 85, "column": 21, "offset": 2368 } } } ], "position": { "start": { "line": 85, "column": 17, "offset": 2364 }, "end": { "line": 85, "column": 25, "offset": 2372 } } } ], "position": { "start": { "line": 85, "column": 13, "offset": 2360 }, "end": { "line": 85, "column": 30, "offset": 2377 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 85, "column": 30, "offset": 2377 }, "end": { "line": 86, "column": 13, "offset": 2390 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "Xbox", "position": { "start": { "line": 86, "column": 17, "offset": 2394 }, "end": { "line": 86, "column": 21, "offset": 2398 } } } ], "position": { "start": { "line": 86, "column": 13, "offset": 2390 }, "end": { "line": 86, "column": 26, "offset": 2403 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 86, "column": 26, "offset": 2403 }, "end": { "line": 87, "column": 9, "offset": 2412 } } } ], "position": { "start": { "line": 84, "column": 9, "offset": 2343 }, "end": { "line": 87, "column": 14, "offset": 2417 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 87, "column": 14, "offset": 2417 }, "end": { "line": 88, "column": 9, "offset": 2426 } } }, { "type": "element", "tagName": "tr", "properties": {}, "children": [ { "type": "text", "value": "\n ", "position": { "start": { "line": 88, "column": 13, "offset": 2430 }, "end": { "line": 89, "column": 13, "offset": 2443 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "element", "tagName": "b", "properties": {}, "children": [ { "type": "text", "value": "6", "position": { "start": { "line": 89, "column": 20, "offset": 2450 }, "end": { "line": 89, "column": 21, "offset": 2451 } } } ], "position": { "start": { "line": 89, "column": 17, "offset": 2447 }, "end": { "line": 89, "column": 25, "offset": 2455 } } } ], "position": { "start": { "line": 89, "column": 13, "offset": 2443 }, "end": { "line": 89, "column": 30, "offset": 2460 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 89, "column": 30, "offset": 2460 }, "end": { "line": 90, "column": 13, "offset": 2473 } } }, { "type": "element", "tagName": "td", "properties": {}, "children": [ { "type": "text", "value": "Team Create", "position": { "start": { "line": 90, "column": 17, "offset": 2477 }, "end": { "line": 90, "column": 28, "offset": 2488 } } } ], "position": { "start": { "line": 90, "column": 13, "offset": 2473 }, "end": { "line": 90, "column": 33, "offset": 2493 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 90, "column": 33, "offset": 2493 }, "end": { "line": 91, "column": 9, "offset": 2502 } } } ], "position": { "start": { "line": 88, "column": 9, "offset": 2426 }, "end": { "line": 91, "column": 14, "offset": 2507 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 91, "column": 14, "offset": 2507 }, "end": { "line": 92, "column": 5, "offset": 2512 } } } ], "position": { "start": { "line": 63, "column": 5, "offset": 1874 }, "end": { "line": 92, "column": 13, "offset": 2520 } } }, { "type": "text", "value": "\n", "position": { "start": { "line": 92, "column": 13, "offset": 2520 }, "end": { "line": 93, "column": 1, "offset": 2521 } } } ], "position": { "start": { "line": 62, "column": 1, "offset": 1862 }, "end": { "line": 93, "column": 9, "offset": 2529 } } }, { "type": "text", "value": "\n", "position": { "start": { "line": 93, "column": 9, "offset": 2529 }, "end": { "line": 94, "column": 1, "offset": 2530 } } } ], "position": { "start": { "line": 60, "column": 1, "offset": 1808 }, "end": { "line": 94, "column": 6, "offset": 2535 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 94, "column": 6, "offset": 2535 }, "end": { "line": 95, "column": 9, "offset": 2544 } } } ], "position": { "start": { "line": 57, "column": 9, "offset": 1734 }, "end": { "line": 95, "column": 14, "offset": 2549 } } }, { "type": "text", "value": "\n ", "position": { "start": { "line": 95, "column": 14, "offset": 2549 }, "end": { "line": 96, "column": 5, "offset": 2554 } } } ], "position": { "start": { "line": 16, "column": 5, "offset": 450 }, "end": { "line": 96, "column": 13, "offset": 2562 } } }, { "type": "text", "value": "\n", "position": { "start": { "line": 96, "column": 13, "offset": 2562 }, "end": { "line": 97, "column": 1, "offset": 2563 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 301 }, "end": { "line": 97, "column": 9, "offset": 2571 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "how-to-get-a-list-of-online-friends", "displayName": "Get a List of Online Friends", "description": "This example demonstrates how to get a dictionary of a player's online\nfriends. It returns the maximum number of friends specified by the argument,\nor 200 if an argument is not provided.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\n\nlocal success, result = pcall(player.GetFriendsOnline, player, 10)\n\nif success then\n\tfor _, friend in pairs(result) do\n\t\tprint(friend.UserName)\n\tend\nelse\n\twarn(\"Failed to get online players: \" .. result)\nend", "expectedOutput": "", "highlightLines": "4\n" } ], "parameters": [ { "name": "maxFriends", "type": "int", "default": "200", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The maximum number of online friends to return. The default is 200.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "Array", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A dictionary of online friends (see the table above).", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 54, "offset": 53 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 54, "offset": 53 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [ "YIELDS" ], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:GetRankInGroup", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the player's rank in the group as an integer between 0 and 255,\nwhere 0 is a non-member and 255 is the group's owner.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 54, "offset": 125 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 54, "offset": 125 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The GetRankInGroup ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 20, "offset": 19 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 20, "offset": 19 }, "end": { "line": 1, "column": 34, "offset": 33 } } }, { "type": "text", "value": " function returns the player's rank in\nthe group as an integer between 0 and 255, where 0 is a non-member and 255\nis the group's owner.", "position": { "start": { "line": 1, "column": 34, "offset": 33 }, "end": { "line": 3, "column": 22, "offset": 168 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 22, "offset": 168 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Using this in a ", "position": { "start": { "line": 5, "column": 1, "offset": 170 }, "end": { "line": 5, "column": 17, "offset": 186 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Script" } ], "position": { "start": { "line": 5, "column": 17, "offset": 186 }, "end": { "line": 5, "column": 31, "offset": 200 } } }, { "type": "text", "value": ", as opposed to a ", "position": { "start": { "line": 5, "column": 31, "offset": 200 }, "end": { "line": 5, "column": 49, "offset": 218 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 5, "column": 49, "offset": 218 }, "end": { "line": 5, "column": 68, "offset": 237 } } }, { "type": "text", "value": ", will\nnot get you the most up-to-date information. If a player leaves a group\nwhile they are in the game, GetRankInGroup will still think they're in\nthat group until they leave. However, this does not happen when used with\na LocalScript.", "position": { "start": { "line": 5, "column": 68, "offset": 237 }, "end": { "line": 9, "column": 15, "offset": 475 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 170 }, "end": { "line": 9, "column": 15, "offset": 475 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This is because the method caches results, so multiple calls of\nGetRankInGroup on the same player with the same group ID will yield the\nsame result as when the method was first called with the given group ID.\nThe caching behavior is on a per-peer basis: a server does not share the\nsame cache as a client.", "position": { "start": { "line": 11, "column": 1, "offset": 477 }, "end": { "line": 15, "column": 24, "offset": 782 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 477 }, "end": { "line": 15, "column": 24, "offset": 782 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-GetRankInGroup1", "displayName": "How to Check a Player's Rank in a Group", "description": "The code below will check if a player that has entered the game has a rank\nequal to 255, in a group with an ID of 2. If they are, it will print \"Player\nis the owner of the group, 'LOL'!\", otherwise \"Player is NOT the owner of the\ngroup, 'LOL'!\" will be printed to the output.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n\tif player:GetRankInGroup(2) == 255 then\n\t\tprint(\"Player is the owner of the group, 'LOL'!\")\n\telse\n\t\tprint(\"Player is NOT the owner of the group, 'LOL'!\")\n\tend\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "groupId", "type": "int64", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "groupId" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 14, "offset": 13 } } }, { "type": "text", "value": " of the specified group.", "position": { "start": { "line": 1, "column": 14, "offset": 13 }, "end": { "line": 1, "column": 38, "offset": 37 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 38, "offset": 37 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "int", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The player's rank in the group.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [ "YIELDS" ], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:GetRoleInGroup", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the player's role in the group as a string, or \"Guest\" if the\nplayer isn't part of the group.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 32, "offset": 101 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 32, "offset": 101 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The GetRoleInGroup ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 20, "offset": 19 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 20, "offset": 19 }, "end": { "line": 1, "column": 34, "offset": 33 } } }, { "type": "text", "value": " function returns the player's role in\nthe group as a string, or ", "position": { "start": { "line": 1, "column": 34, "offset": 33 }, "end": { "line": 2, "column": 27, "offset": 98 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "Guest", "position": { "start": { "line": 2, "column": 28, "offset": 99 }, "end": { "line": 2, "column": 33, "offset": 104 } } } ], "position": { "start": { "line": 2, "column": 27, "offset": 98 }, "end": { "line": 2, "column": 34, "offset": 105 } } }, { "type": "text", "value": " if the player isn't part of the group.", "position": { "start": { "line": 2, "column": 34, "offset": 105 }, "end": { "line": 2, "column": 73, "offset": 144 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 73, "offset": 144 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Using this in a ", "position": { "start": { "line": 4, "column": 1, "offset": 146 }, "end": { "line": 4, "column": 17, "offset": 162 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Script" } ], "position": { "start": { "line": 4, "column": 17, "offset": 162 }, "end": { "line": 4, "column": 31, "offset": 176 } } }, { "type": "text", "value": ", as opposed to a ", "position": { "start": { "line": 4, "column": 31, "offset": 176 }, "end": { "line": 4, "column": 49, "offset": 194 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 4, "column": 49, "offset": 194 }, "end": { "line": 4, "column": 68, "offset": 213 } } }, { "type": "text", "value": ", will\nnot get you the most up-to-date information. If a player leaves a group\nwhile they are in the game, GetRoleInGroup will still think they're in\nthat group until they leave. However, this does not happen when used with\na LocalScript.", "position": { "start": { "line": 4, "column": 68, "offset": 213 }, "end": { "line": 8, "column": 15, "offset": 451 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 146 }, "end": { "line": 8, "column": 15, "offset": 451 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This is because the method caches results, so multiple calls of\nGetRoleInGroup on the same player with the same group ID will yield the\nsame result as when the method was first called with the given group ID.\nThe caching behavior is on a per-peer basis: a server does not share the\nsame cache as a client.", "position": { "start": { "line": 10, "column": 1, "offset": 453 }, "end": { "line": 14, "column": 24, "offset": 758 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 453 }, "end": { "line": 14, "column": 24, "offset": 758 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-GetRoleInGroup1", "displayName": "How to Check a Player's Role in a Group", "description": "The code below will print the name of the rank that the player is currently a\npart of, in a specific group. In this instance we're checking what rank the\nplayer is within a group which has a group ID of 2.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n\tprint(\"Player is ranked as '\", player:GetRoleInGroup(2), \"' in group, 'LOL'!\")\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "groupId", "type": "int64", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "groupId", "position": { "start": { "line": 1, "column": 6, "offset": 5 }, "end": { "line": 1, "column": 13, "offset": 12 } } } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 14, "offset": 13 } } }, { "type": "text", "value": " of the specified group.", "position": { "start": { "line": 1, "column": 14, "offset": 13 }, "end": { "line": 1, "column": 38, "offset": 37 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 38, "offset": 37 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "string", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The player's role in the specified group, or ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 46, "offset": 45 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "Guest", "position": { "start": { "line": 1, "column": 47, "offset": 46 }, "end": { "line": 1, "column": 52, "offset": 51 } } } ], "position": { "start": { "line": 1, "column": 46, "offset": 45 }, "end": { "line": 1, "column": 53, "offset": 52 } } }, { "type": "text", "value": " of the player is\nnot a member.", "position": { "start": { "line": 1, "column": 53, "offset": 52 }, "end": { "line": 2, "column": 14, "offset": 83 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 14, "offset": 83 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [ "YIELDS" ], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:IsBestFriendsWith", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns whether a player is friends with the specified user.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 61, "offset": 60 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 61, "offset": 60 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function was once used to return whether a player is best friends\nwith the specified user, but the best friend feature has since been\nremoved.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 9, "offset": 147 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 9, "offset": 147 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "userId", "type": "int64", "default": "null", "summary": "" } ], "returns": [ { "type": "bool", "summary": "" } ], "tags": [ "YIELDS", "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function is obsolete because the Best Friends feature was removed.\nUse ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 5, "offset": 76 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:IsFriendsWith()" } ], "position": { "start": { "line": 2, "column": 5, "offset": 76 }, "end": { "line": 2, "column": 35, "offset": 106 } } }, { "type": "text", "value": " instead.", "position": { "start": { "line": 2, "column": 35, "offset": 106 }, "end": { "line": 2, "column": 44, "offset": 115 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 44, "offset": 115 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:IsFriendsWith", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Checks whether a player is a friend of the user with the given\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 63 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.UserId" } ], "position": { "start": { "line": 2, "column": 1, "offset": 63 }, "end": { "line": 2, "column": 22, "offset": 84 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 2, "column": 22, "offset": 84 }, "end": { "line": 2, "column": 23, "offset": 85 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 23, "offset": 85 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function sends a request to the Roblox website asking whether a\nplayer is a friend of another user, given the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 47, "offset": 115 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.UserId" } ], "position": { "start": { "line": 2, "column": 47, "offset": 115 }, "end": { "line": 2, "column": 68, "offset": 136 } } }, { "type": "text", "value": " of\nthat user. This function caches results so multiple calls of the function\non the same player with the same ", "position": { "start": { "line": 2, "column": 68, "offset": 136 }, "end": { "line": 4, "column": 34, "offset": 247 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.UserId" } ], "position": { "start": { "line": 4, "column": 34, "offset": 247 }, "end": { "line": 4, "column": 55, "offset": 268 } } }, { "type": "text", "value": " may not yield the\nmost up-to-date result. This does not happen when used in a\n", "position": { "start": { "line": 4, "column": 55, "offset": 268 }, "end": { "line": 6, "column": 1, "offset": 347 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 6, "column": 1, "offset": 347 }, "end": { "line": 6, "column": 20, "offset": 366 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 6, "column": 20, "offset": 366 }, "end": { "line": 6, "column": 21, "offset": 367 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 6, "column": 21, "offset": 367 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-IsFriendsWith1", "displayName": "How to Check if a Player is a Friend", "description": "The below example would print whether or not a recently added player is\nfriends with Gordonrox24.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n\tif player:IsFriendsWith(146569) then\n\t\tprint(player.Name .. \" is friends with gordonrox24!\")\n\tend\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "userId", "type": "int64", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.UserId" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 26, "offset": 25 } } }, { "type": "text", "value": " of the specified player.", "position": { "start": { "line": 1, "column": 26, "offset": 25 }, "end": { "line": 1, "column": 51, "offset": 50 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 51, "offset": 50 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "bool", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A boolean indicating whether a player is a friend of the specified\nuser.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 6, "offset": 72 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 6, "offset": 72 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [ "YIELDS" ], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:IsInGroup", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Checks whether a player is a member of a group with the given ID.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 66, "offset": 65 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 66, "offset": 65 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The IsInGroup ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 15, "offset": 14 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 15, "offset": 14 }, "end": { "line": 1, "column": 29, "offset": 28 } } }, { "type": "text", "value": " function sends a request to the Roblox\nwebsite asking whether a player is a member of a group, given the ID of\nthat group.", "position": { "start": { "line": 1, "column": 29, "offset": 28 }, "end": { "line": 3, "column": 12, "offset": 151 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 12, "offset": 151 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Using this in a ", "position": { "start": { "line": 5, "column": 1, "offset": 153 }, "end": { "line": 5, "column": 17, "offset": 169 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Script" } ], "position": { "start": { "line": 5, "column": 17, "offset": 169 }, "end": { "line": 5, "column": 31, "offset": 183 } } }, { "type": "text", "value": ", as opposed to a ", "position": { "start": { "line": 5, "column": 31, "offset": 183 }, "end": { "line": 5, "column": 49, "offset": 201 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 5, "column": 49, "offset": 201 }, "end": { "line": 5, "column": 68, "offset": 220 } } }, { "type": "text", "value": ", will\nnot get you the most up-to-date information. If a player leaves a group\nwhile they are in the game, IsInGroup will still think they're in that\ngroup until they leave. However, this does not happen when used with a\nLocalScript.", "position": { "start": { "line": 5, "column": 68, "offset": 220 }, "end": { "line": 9, "column": 13, "offset": 453 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 153 }, "end": { "line": 9, "column": 13, "offset": 453 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This is because the method caches results, so multiple calls of IsInGroup\non the same player with the same group ID will yield the same result as\nwhen the method was first called with the given group ID. The caching\nbehavior is on a per-peer basis: a server does not share the same cache as\na client.", "position": { "start": { "line": 11, "column": 1, "offset": 455 }, "end": { "line": 15, "column": 10, "offset": 755 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 455 }, "end": { "line": 15, "column": 10, "offset": 755 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-IsInGroup1", "displayName": "How to Check if a Player is in a Group", "description": "The below example will print \"Player is in the Roblox Fan club!\" if the newly\nadded player is in the group with a groupId of 7.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n\tif player:IsInGroup(7) then\n\t\tprint(\"Player is in the Roblox Fan club!\")\n\tend\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "groupId", "type": "int64", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "groupId", "position": { "start": { "line": 1, "column": 6, "offset": 5 }, "end": { "line": 1, "column": 13, "offset": 12 } } } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 14, "offset": 13 } } }, { "type": "text", "value": " of the specified group.", "position": { "start": { "line": 1, "column": 14, "offset": 13 }, "end": { "line": 1, "column": 38, "offset": 37 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 38, "offset": 37 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "bool", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A boolean indicating whether the player is in the specified group.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 67, "offset": 66 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 67, "offset": 66 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [ "YIELDS" ], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:LoadCharacter", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Creates a new character for the player, removing the old one. Also clears\nthe player's ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 14, "offset": 87 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Backpack" } ], "position": { "start": { "line": 2, "column": 14, "offset": 87 }, "end": { "line": 2, "column": 30, "offset": 103 } } }, { "type": "text", "value": " and ", "position": { "start": { "line": 2, "column": 30, "offset": 103 }, "end": { "line": 2, "column": 35, "offset": 108 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.PlayerGui" } ], "position": { "start": { "line": 2, "column": 35, "offset": 108 }, "end": { "line": 2, "column": 52, "offset": 125 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 2, "column": 52, "offset": 125 }, "end": { "line": 2, "column": 53, "offset": 126 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 53, "offset": 126 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The LoadCharacter ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 19, "offset": 18 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 19, "offset": 18 }, "end": { "line": 1, "column": 33, "offset": 32 } } }, { "type": "text", "value": " function creates a new character for the\nplayer, removing the old one. It also clears the player's ", "position": { "start": { "line": 1, "column": 33, "offset": 32 }, "end": { "line": 2, "column": 59, "offset": 132 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Backpack" } ], "position": { "start": { "line": 2, "column": 59, "offset": 132 }, "end": { "line": 2, "column": 75, "offset": 148 } } }, { "type": "text", "value": "\nand ", "position": { "start": { "line": 2, "column": 75, "offset": 148 }, "end": { "line": 3, "column": 5, "offset": 153 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.PlayerGui" } ], "position": { "start": { "line": 3, "column": 5, "offset": 153 }, "end": { "line": 3, "column": 22, "offset": 170 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 3, "column": 22, "offset": 170 }, "end": { "line": 3, "column": 23, "offset": 171 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 23, "offset": 171 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This is useful in cases where you want to reload the character without\nkilling the player, such as when you want to load a new character\nappearance after changing the player's ", "position": { "start": { "line": 5, "column": 1, "offset": 173 }, "end": { "line": 7, "column": 40, "offset": 349 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.CharacterAppearance" } ], "position": { "start": { "line": 7, "column": 40, "offset": 349 }, "end": { "line": 7, "column": 74, "offset": 383 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 7, "column": 74, "offset": 383 }, "end": { "line": 7, "column": 75, "offset": 384 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 173 }, "end": { "line": 7, "column": 75, "offset": 384 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note: The function is similar to ", "position": { "start": { "line": 9, "column": 1, "offset": 386 }, "end": { "line": 9, "column": 34, "offset": 419 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadCharacterBlocking()" } ], "position": { "start": { "line": 9, "column": 34, "offset": 419 }, "end": { "line": 9, "column": 72, "offset": 457 } } }, { "type": "text", "value": ",\nbut the request is processed asynchronously instead of synchronously. This\nmeans other tasks will be able to continue while the character is being\nloaded, including the rendering of the game and any other tasks. Also,\nthis function can be used in a script, while LoadCharacterBlocking cannot.", "position": { "start": { "line": 9, "column": 72, "offset": 457 }, "end": { "line": 13, "column": 75, "offset": 751 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 386 }, "end": { "line": 13, "column": 75, "offset": 751 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "After calling LoadCharacter for an individual player, it is not\nrecommended to call it again for the same player until after that player's\n", "position": { "start": { "line": 15, "column": 1, "offset": 753 }, "end": { "line": 17, "column": 1, "offset": 892 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.CharacterAppearanceLoaded" } ], "position": { "start": { "line": 17, "column": 1, "offset": 892 }, "end": { "line": 17, "column": 41, "offset": 932 } } }, { "type": "text", "value": " event has fired.", "position": { "start": { "line": 17, "column": 41, "offset": 932 }, "end": { "line": 17, "column": 58, "offset": 949 } } } ], "position": { "start": { "line": 15, "column": 1, "offset": 753 }, "end": { "line": 17, "column": 58, "offset": 949 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Character Loading Event order", "position": { "start": { "line": 19, "column": 6, "offset": 956 }, "end": { "line": 19, "column": 35, "offset": 985 } } } ], "position": { "start": { "line": 19, "column": 1, "offset": 951 }, "end": { "line": 19, "column": 35, "offset": 985 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Calling the ", "position": { "start": { "line": 21, "column": 1, "offset": 987 }, "end": { "line": 21, "column": 13, "offset": 999 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadCharacter()" } ], "position": { "start": { "line": 21, "column": 13, "offset": 999 }, "end": { "line": 21, "column": 43, "offset": 1029 } } }, { "type": "text", "value": " with an R15 Avatar fires events\nin the following order (Note: R6 ordering is different):", "position": { "start": { "line": 21, "column": 43, "offset": 1029 }, "end": { "line": 22, "column": 57, "offset": 1118 } } } ], "position": { "start": { "line": 21, "column": 1, "offset": 987 }, "end": { "line": 22, "column": 57, "offset": 1118 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ol", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Player.Character sets", "position": { "start": { "line": 24, "column": 4, "offset": 1123 }, "end": { "line": 24, "column": 25, "offset": 1144 } } } ], "position": { "start": { "line": 24, "column": 1, "offset": 1120 }, "end": { "line": 24, "column": 25, "offset": 1144 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Player.CharacterAdded fires", "position": { "start": { "line": 25, "column": 4, "offset": 1148 }, "end": { "line": 25, "column": 31, "offset": 1175 } } } ], "position": { "start": { "line": 25, "column": 1, "offset": 1145 }, "end": { "line": 25, "column": 31, "offset": 1175 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Player.Changed fires with a value of \"Character\"", "position": { "start": { "line": 26, "column": 4, "offset": 1179 }, "end": { "line": 26, "column": 52, "offset": 1227 } } } ], "position": { "start": { "line": 26, "column": 1, "offset": 1176 }, "end": { "line": 26, "column": 52, "offset": 1227 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Character appearance initializes", "position": { "start": { "line": 27, "column": 4, "offset": 1231 }, "end": { "line": 27, "column": 36, "offset": 1263 } } } ], "position": { "start": { "line": 27, "column": 1, "offset": 1228 }, "end": { "line": 27, "column": 36, "offset": 1263 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Player.CharacterAppearanceLoaded fires", "position": { "start": { "line": 28, "column": 4, "offset": 1267 }, "end": { "line": 28, "column": 42, "offset": 1305 } } } ], "position": { "start": { "line": 28, "column": 1, "offset": 1264 }, "end": { "line": 28, "column": 42, "offset": 1305 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Character.Parent sets to the DataModel", "position": { "start": { "line": 29, "column": 4, "offset": 1309 }, "end": { "line": 29, "column": 42, "offset": 1347 } } } ], "position": { "start": { "line": 29, "column": 1, "offset": 1306 }, "end": { "line": 29, "column": 42, "offset": 1347 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "The Character rig builds, and the Character scales", "position": { "start": { "line": 30, "column": 4, "offset": 1351 }, "end": { "line": 30, "column": 54, "offset": 1401 } } } ], "position": { "start": { "line": 30, "column": 1, "offset": 1348 }, "end": { "line": 30, "column": 54, "offset": 1401 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Character moves to the spawn location", "position": { "start": { "line": 31, "column": 4, "offset": 1405 }, "end": { "line": 31, "column": 41, "offset": 1442 } } } ], "position": { "start": { "line": 31, "column": 1, "offset": 1402 }, "end": { "line": 31, "column": 41, "offset": 1442 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "LoadCharacter returns", "position": { "start": { "line": 32, "column": 4, "offset": 1446 }, "end": { "line": 32, "column": 25, "offset": 1467 } } } ], "position": { "start": { "line": 32, "column": 1, "offset": 1443 }, "end": { "line": 32, "column": 25, "offset": 1467 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 24, "column": 1, "offset": 1120 }, "end": { "line": 32, "column": 25, "offset": 1467 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-LoadCharacter1", "displayName": "Turn Off Auto-Loading and Simulate Character Respawn", "description": "This script turns off auto-loading and simulates character respawning.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal RESPAWN_DELAY = 5\n\nPlayers.CharacterAutoLoads = false\n\nlocal function onPlayerAdded(player)\n\tlocal function onCharacterAdded(character)\n\t\tlocal humanoid = character:WaitForChild(\"Humanoid\")\n\n\t\tlocal function onDied()\n\t\t\ttask.wait(RESPAWN_DELAY)\n\t\t\tplayer:LoadCharacter()\n\t\tend\n\n\t\thumanoid.Died:Connect(onDied)\n\tend\n\n\tplayer.CharacterAdded:Connect(onCharacterAdded)\n\n\tplayer:LoadCharacter()\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "YIELDS" ], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:LoadCharacterWithHumanoidDescription", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Spawns an avatar so it has everything equipped in the passed in\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 64 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.HumanoidDescription" } ], "position": { "start": { "line": 2, "column": 1, "offset": 64 }, "end": { "line": 2, "column": 28, "offset": 91 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 2, "column": 28, "offset": 91 }, "end": { "line": 2, "column": 29, "offset": 92 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 29, "offset": 92 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function spawns an avatar so it has everything equipped in the passed\nin ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 4, "offset": 78 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.HumanoidDescription" } ], "position": { "start": { "line": 2, "column": 4, "offset": 78 }, "end": { "line": 2, "column": 31, "offset": 105 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 2, "column": 31, "offset": 105 }, "end": { "line": 2, "column": 32, "offset": 106 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 32, "offset": 106 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "After calling LoadCharacterWithHumanoidDescription for an individual\nplayer, it is not recommended to call the function again for the same\nplayer until after that player's ", "position": { "start": { "line": 4, "column": 1, "offset": 108 }, "end": { "line": 6, "column": 34, "offset": 280 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.CharacterAppearanceLoaded" } ], "position": { "start": { "line": 6, "column": 34, "offset": 280 }, "end": { "line": 6, "column": 74, "offset": 320 } } }, { "type": "text", "value": "\nevent has fired.", "position": { "start": { "line": 6, "column": 74, "offset": 320 }, "end": { "line": 7, "column": 17, "offset": 337 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 108 }, "end": { "line": 7, "column": 17, "offset": 337 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also:", "position": { "start": { "line": 9, "column": 1, "offset": 339 }, "end": { "line": 9, "column": 10, "offset": 348 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 339 }, "end": { "line": 9, "column": 10, "offset": 348 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "a", "properties": { "href": "/characters/appearance#humanoiddescription" }, "children": [ { "type": "text", "value": "HumanoidDescription System", "position": { "start": { "line": 11, "column": 4, "offset": 353 }, "end": { "line": 11, "column": 30, "offset": 379 } } } ], "position": { "start": { "line": 11, "column": 3, "offset": 352 }, "end": { "line": 11, "column": 75, "offset": 424 } } }, { "type": "text", "value": ",\nan article which explains the humanoid description system in greater\ndetail and provides several scripting examples", "position": { "start": { "line": 11, "column": 75, "offset": 424 }, "end": { "line": 13, "column": 49, "offset": 545 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 350 }, "end": { "line": 13, "column": 49, "offset": 545 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 11, "column": 1, "offset": 350 }, "end": { "line": 13, "column": 49, "offset": 545 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "spawn-characters-with-humanoiddescription", "displayName": "Spawn Characters With HumanoidDescription", "description": "To create a `HumanoidDescription` and then spawn a character with that\ndescription applied, add a `Script` (not a `LocalScript`) to the workspace and\nadd this code to it.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nPlayers.CharacterAutoLoads = false\n\nlocal function onPlayerAdded(player)\n\tlocal humanoidDescription = Instance.new(\"HumanoidDescription\")\n\thumanoidDescription.HatAccessory = \"2551510151,2535600138\"\n\thumanoidDescription.BodyTypeScale = 0.1\n\thumanoidDescription.ClimbAnimation = 619521311\n\thumanoidDescription.Face = 86487700\n\thumanoidDescription.GraphicTShirt = 1711661\n\thumanoidDescription.HeadColor = Color3.new(0, 1, 0)\n\tplayer:LoadCharacterWithHumanoidDescription(humanoidDescription)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "humanoidDescription", "type": "HumanoidDescription", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 3, "offset": 2 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.HumanoidDescription" } ], "position": { "start": { "line": 1, "column": 3, "offset": 2 }, "end": { "line": 1, "column": 30, "offset": 29 } } }, { "type": "text", "value": " containing traits like body\nparts/colors, body scaling, accessories, clothing, and animations that\nwill be equipped to the loaded character.", "position": { "start": { "line": 1, "column": 30, "offset": 29 }, "end": { "line": 3, "column": 42, "offset": 170 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 42, "offset": 170 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "YIELDS" ], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:RequestStreamAroundAsync", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Requests that the server stream to the player around the specified\nlocation.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 10, "offset": 76 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 10, "offset": 76 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "For games where ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 17, "offset": 16 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Workspace.StreamingEnabled|StreamingEnabled" } ], "position": { "start": { "line": 1, "column": 17, "offset": 16 }, "end": { "line": 1, "column": 68, "offset": 67 } } }, { "type": "text", "value": " is set\nto ", "position": { "start": { "line": 1, "column": 68, "offset": 67 }, "end": { "line": 2, "column": 4, "offset": 78 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "true", "position": { "start": { "line": 2, "column": 6, "offset": 80 }, "end": { "line": 2, "column": 10, "offset": 84 } } } ], "position": { "start": { "line": 2, "column": 4, "offset": 78 }, "end": { "line": 2, "column": 12, "offset": 86 } } }, { "type": "text", "value": ", requests that the server stream to the player regions (parts\nand terrain) around the specified ", "position": { "start": { "line": 2, "column": 12, "offset": 86 }, "end": { "line": 3, "column": 35, "offset": 183 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "X", "position": { "start": { "line": 3, "column": 37, "offset": 185 }, "end": { "line": 3, "column": 38, "offset": 186 } } } ], "position": { "start": { "line": 3, "column": 35, "offset": 183 }, "end": { "line": 3, "column": 40, "offset": 188 } } }, { "type": "text", "value": ", ", "position": { "start": { "line": 3, "column": 40, "offset": 188 }, "end": { "line": 3, "column": 42, "offset": 190 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Y", "position": { "start": { "line": 3, "column": 44, "offset": 192 }, "end": { "line": 3, "column": 45, "offset": 193 } } } ], "position": { "start": { "line": 3, "column": 42, "offset": 190 }, "end": { "line": 3, "column": 47, "offset": 195 } } }, { "type": "text", "value": ", ", "position": { "start": { "line": 3, "column": 47, "offset": 195 }, "end": { "line": 3, "column": 49, "offset": 197 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Z", "position": { "start": { "line": 3, "column": 51, "offset": 199 }, "end": { "line": 3, "column": 52, "offset": 200 } } } ], "position": { "start": { "line": 3, "column": 49, "offset": 197 }, "end": { "line": 3, "column": 54, "offset": 202 } } }, { "type": "text", "value": " location in the game\nworld. It is useful if the game knows that the player's ", "position": { "start": { "line": 3, "column": 54, "offset": 202 }, "end": { "line": 4, "column": 57, "offset": 280 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Datatype.CFrame" } ], "position": { "start": { "line": 4, "column": 57, "offset": 280 }, "end": { "line": 4, "column": 74, "offset": 297 } } }, { "type": "text", "value": "\nwill be set to the specified location in the near future. Without\nproviding the location with this call, the player may not have streamed in\ncontent for the destination, resulting in a streaming pause or other\nundesirable behavior.", "position": { "start": { "line": 4, "column": 74, "offset": 297 }, "end": { "line": 8, "column": 22, "offset": 529 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 8, "column": 22, "offset": 529 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The effect of this call will be temporary and there are no guarantees of\nwhat will be streamed in around the specified location. Client memory\nlimits and network conditions may impact what will be available on the\nclient.", "position": { "start": { "line": 10, "column": 1, "offset": 531 }, "end": { "line": 13, "column": 8, "offset": 752 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 531 }, "end": { "line": 13, "column": 8, "offset": 752 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See\n", "position": { "start": { "line": 15, "column": 1, "offset": 754 }, "end": { "line": 16, "column": 1, "offset": 758 } } }, { "type": "element", "tagName": "a", "properties": { "href": "/workspace/streaming#requesting-area-streaming" }, "children": [ { "type": "text", "value": "Requesting Area Streaming", "position": { "start": { "line": 16, "column": 2, "offset": 759 }, "end": { "line": 16, "column": 27, "offset": 784 } } } ], "position": { "start": { "line": 16, "column": 1, "offset": 758 }, "end": { "line": 16, "column": 76, "offset": 833 } } }, { "type": "text", "value": "\nfor details.", "position": { "start": { "line": 16, "column": 76, "offset": 833 }, "end": { "line": 17, "column": 13, "offset": 846 } } } ], "position": { "start": { "line": 15, "column": 1, "offset": 754 }, "end": { "line": 17, "column": 13, "offset": 846 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h5", "properties": {}, "children": [ { "type": "text", "value": "Usage Precaution", "position": { "start": { "line": 19, "column": 7, "offset": 854 }, "end": { "line": 19, "column": 23, "offset": 870 } } } ], "position": { "start": { "line": 19, "column": 1, "offset": 848 }, "end": { "line": 19, "column": 23, "offset": 870 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Requesting streaming around an area is ", "position": { "start": { "line": 21, "column": 1, "offset": 872 }, "end": { "line": 21, "column": 40, "offset": 911 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "not a guarantee", "position": { "start": { "line": 21, "column": 42, "offset": 913 }, "end": { "line": 21, "column": 57, "offset": 928 } } } ], "position": { "start": { "line": 21, "column": 40, "offset": 911 }, "end": { "line": 21, "column": 59, "offset": 930 } } }, { "type": "text", "value": " that the\ncontent will be present when the request completes, as streaming is\naffected by the client's network bandwidth, memory limitations, and other\nfactors.", "position": { "start": { "line": 21, "column": 59, "offset": 930 }, "end": { "line": 24, "column": 9, "offset": 1090 } } } ], "position": { "start": { "line": 21, "column": 1, "offset": 872 }, "end": { "line": 24, "column": 9, "offset": 1090 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "position", "type": "Vector3", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "World location where streaming is requested.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 45, "offset": 44 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 45, "offset": 44 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } }, { "name": "timeOut", "type": "double", "default": "0", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Optional timeout for the request.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 34, "offset": 33 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 34, "offset": 33 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "YIELDS" ], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:WaitForDataReady", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Used to pause the script until the player's data is available to\nmanipulate, or until a certain amount of time has elapsed without fetching\nthe player's data.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 19, "offset": 158 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 19, "offset": 158 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function is used to pause the script until the player's data is\navailable to manipulate, or until a certain amount of time has elapsed\nwithout fetching the player's data", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 35, "offset": 174 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 35, "offset": 174 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [], "returns": [ { "type": "bool", "summary": "" } ], "tags": [ "YIELDS", "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated, as it may have been used for a now obsolete data\npersistence method. Please save and load player data using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 133 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataStoreService" } ], "position": { "start": { "line": 3, "column": 1, "offset": 133 }, "end": { "line": 3, "column": 25, "offset": 157 } } }, { "type": "text", "value": " for new work.", "position": { "start": { "line": 3, "column": 25, "offset": 157 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 39, "offset": 171 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:isFriendsWith", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "userId", "type": "int64", "default": "null", "summary": "" } ], "returns": [ { "type": "bool", "summary": "" } ], "tags": [ "YIELDS", "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated function is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:IsFriendsWith()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 72, "offset": 71 } } }, { "type": "text", "value": "\nwhich should be used instead.", "position": { "start": { "line": 1, "column": 72, "offset": 71 }, "end": { "line": 2, "column": 30, "offset": 101 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 30, "offset": 101 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Player:waitForDataReady", "summary": "", "description": "", "codeSamples": null, "parameters": [], "returns": [ { "type": "bool", "summary": "" } ], "tags": [ "YIELDS", "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function is a deprecated variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:WaitForDataReady()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 75, "offset": 74 } } }, { "type": "text", "value": "\nwhich has also been deprecated. Neither function should be used in new\nwork.", "position": { "start": { "line": 1, "column": 75, "offset": 74 }, "end": { "line": 3, "column": 6, "offset": 151 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 6, "offset": 151 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" } ], "events": [ { "name": "Player.CharacterAdded", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fired when a player's character spawns or respawns.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 52, "offset": 51 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 52, "offset": 51 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "CharacterAdded", "position": { "start": { "line": 1, "column": 7, "offset": 6 }, "end": { "line": 1, "column": 21, "offset": 20 } } } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 23, "offset": 22 } } }, { "type": "text", "value": " event fires when a player's character spawns (or\nrespawns). This event fires soon after setting ", "position": { "start": { "line": 1, "column": 23, "offset": 22 }, "end": { "line": 2, "column": 48, "offset": 119 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 2, "column": 48, "offset": 119 }, "end": { "line": 2, "column": 72, "offset": 143 } } }, { "type": "text", "value": " to\na non-", "position": { "start": { "line": 2, "column": 72, "offset": 143 }, "end": { "line": 3, "column": 7, "offset": 153 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "nil" } ], "position": { "start": { "line": 3, "column": 7, "offset": 153 }, "end": { "line": 3, "column": 12, "offset": 158 } } }, { "type": "text", "value": " value or calling ", "position": { "start": { "line": 3, "column": 12, "offset": 158 }, "end": { "line": 3, "column": 30, "offset": 176 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player:LoadCharacter()" } ], "position": { "start": { "line": 3, "column": 30, "offset": 176 }, "end": { "line": 3, "column": 60, "offset": 206 } } }, { "type": "text", "value": ", which is\nbefore the character is parented to the ", "position": { "start": { "line": 3, "column": 60, "offset": 206 }, "end": { "line": 4, "column": 41, "offset": 257 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Workspace" } ], "position": { "start": { "line": 4, "column": 41, "offset": 257 }, "end": { "line": 4, "column": 58, "offset": 274 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 4, "column": 58, "offset": 274 }, "end": { "line": 4, "column": 59, "offset": 275 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 59, "offset": 275 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This can be used alongside the ", "position": { "start": { "line": 6, "column": 1, "offset": 277 }, "end": { "line": 6, "column": 32, "offset": 308 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.CharacterRemoving" } ], "position": { "start": { "line": 6, "column": 32, "offset": 308 }, "end": { "line": 6, "column": 64, "offset": 340 } } }, { "type": "text", "value": " event,\nwhich fires right before a player's character is about to be removed,\ntypically after death. As such, both of these events can potentially fire\nmany times as players die then respawn in a place. If you want to detect\nwhen a player joins or leaves the game, use the\n", "position": { "start": { "line": 6, "column": 64, "offset": 340 }, "end": { "line": 11, "column": 1, "offset": 613 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players.PlayerAdded" } ], "position": { "start": { "line": 11, "column": 1, "offset": 613 }, "end": { "line": 11, "column": 28, "offset": 640 } } }, { "type": "text", "value": " and ", "position": { "start": { "line": 11, "column": 28, "offset": 640 }, "end": { "line": 11, "column": 33, "offset": 645 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players.PlayerRemoving" } ], "position": { "start": { "line": 11, "column": 33, "offset": 645 }, "end": { "line": 11, "column": 63, "offset": 675 } } }, { "type": "text", "value": " events\ninstead.", "position": { "start": { "line": 11, "column": 63, "offset": 675 }, "end": { "line": 12, "column": 9, "offset": 691 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 277 }, "end": { "line": 12, "column": 9, "offset": 691 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note that the ", "position": { "start": { "line": 14, "column": 1, "offset": 693 }, "end": { "line": 14, "column": 15, "offset": 707 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Humanoid" } ], "position": { "start": { "line": 14, "column": 15, "offset": 707 }, "end": { "line": 14, "column": 31, "offset": 723 } } }, { "type": "text", "value": " and its default body parts (head, torso,\nand limbs) will exist when this event fires, but clothing items like\n", "position": { "start": { "line": 14, "column": 31, "offset": 723 }, "end": { "line": 16, "column": 1, "offset": 834 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Hat|Hats" } ], "position": { "start": { "line": 16, "column": 1, "offset": 834 }, "end": { "line": 16, "column": 17, "offset": 850 } } }, { "type": "text", "value": ", ", "position": { "start": { "line": 16, "column": 17, "offset": 850 }, "end": { "line": 16, "column": 19, "offset": 852 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Shirt|Shirts" } ], "position": { "start": { "line": 16, "column": 19, "offset": 852 }, "end": { "line": 16, "column": 39, "offset": 872 } } }, { "type": "text", "value": ", and ", "position": { "start": { "line": 16, "column": 39, "offset": 872 }, "end": { "line": 16, "column": 45, "offset": 878 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Pants" } ], "position": { "start": { "line": 16, "column": 45, "offset": 878 }, "end": { "line": 16, "column": 58, "offset": 891 } } }, { "type": "text", "value": " may take a few\nseconds to be added to the character. Connect ", "position": { "start": { "line": 16, "column": 58, "offset": 891 }, "end": { "line": 17, "column": 47, "offset": 953 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ChildAdded" } ], "position": { "start": { "line": 17, "column": 47, "offset": 953 }, "end": { "line": 17, "column": 74, "offset": 980 } } }, { "type": "text", "value": "\non the added character to detect these, or wait for the\n", "position": { "start": { "line": 17, "column": 74, "offset": 980 }, "end": { "line": 19, "column": 1, "offset": 1037 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.CharacterAppearanceLoaded" } ], "position": { "start": { "line": 19, "column": 1, "offset": 1037 }, "end": { "line": 19, "column": 41, "offset": 1077 } } }, { "type": "text", "value": " event to be sure the character\nhas everything equipped.", "position": { "start": { "line": 19, "column": 41, "offset": 1077 }, "end": { "line": 20, "column": 25, "offset": 1133 } } } ], "position": { "start": { "line": 14, "column": 1, "offset": 693 }, "end": { "line": 20, "column": 25, "offset": 1133 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "spawns-and-despawns", "displayName": "Detecting Player Spawns and Despawns", "description": "This code sample demonstrates the usage of `Class.Players.PlayerAdded`,\n`Class.Player.CharacterAdded` and `Class.Player.CharacterRemoving` in order to\ndetect the spawning and despawning of players' characters. You can use this as\na boilerplate script to make changes to players' characters as they spawn,\nsuch as changing `Class.Humanoid.WalkSpeed`.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onCharacterAdded(character)\n\tprint(character.Name .. \" has spawned\")\nend\n\nlocal function onCharacterRemoving(character)\n\tprint(character.Name .. \" is despawning\")\nend\n\nlocal function onPlayerAdded(player)\n\tplayer.CharacterAdded:Connect(onCharacterAdded)\n\tplayer.CharacterRemoving:Connect(onCharacterRemoving)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "Player1 has spawned\nPlayer1 is despawning", "highlightLines": "" }, { "identifier": "respawn-at-same-spot", "displayName": "Respawn at Despawn Location", "description": "This code sample will cause players to respawn at the same place they died. It\ndoes this by keeping track of where the player despawned using\n`Class.Player.CharacterRemoving`. Note that the player's location is saved\non-despawn, not on-death. This can be problematic if the player falls off a\nledge and dies due to `Class.Workspace.FallenPartsDestroyHeight` - their\nrespawn position won't be saved in this case.\n\nIt's also important to note the need to \"forget\" the location of players who\nleave the game. We use `Class.Instance.ChildRemoved` on `Players` instead of\n`Class.Players.PlayerRemoving`. This is because PlayerRemoving fires before\nCharacterRemoving - and we need to make sure we don't forget the player's\nrespawn location then immediately remember a new one (this is a memory leak;\npotentially many players could visit, respawn and leave). So, we use\nChildRemoved on Players so the event fires after the character is removed.\n", "codeSample": "local Players = game:GetService(\"Players\")\nlocal RunService = game:GetService(\"RunService\")\n\n-- This table maps \"Player\" objects to Vector3\nlocal respawnLocations = {}\n\nlocal function onCharacterAdded(character)\n\tlocal player = Players:GetPlayerFromCharacter(character)\n\t-- Check if we saved a respawn location for this player\n\tif respawnLocations[player] then\n\t\t-- Teleport the player there when their HumanoidRootPart is available\n\t\tlocal hrp = character:WaitForChild(\"HumanoidRootPart\")\n\t\t-- Wait a brief moment before teleporting, as Roblox will teleport the\n\t\t-- player to their designated SpawnLocation (which we will override)\n\t\tRunService.Stepped:wait()\n\t\thrp.CFrame = CFrame.new(respawnLocations[player] + Vector3.new(0, 3.5, 0))\n\tend\nend\n\nlocal function onCharacterRemoving(character)\n\t-- Get the player and their HumanoidRootPart and save their death location\n\tlocal player = Players:GetPlayerFromCharacter(character)\n\tlocal hrp = character:FindFirstChild(\"HumanoidRootPart\")\n\tif hrp then\n\t\trespawnLocations[player] = hrp.Position\n\tend\nend\n\nlocal function onPlayerAdded(player)\n\t-- Listen for spawns/despawns\n\tplayer.CharacterAdded:Connect(onCharacterAdded)\n\tplayer.CharacterRemoving:Connect(onCharacterRemoving)\nend\n\nlocal function onPlayerRemoved(player)\n\t-- Forget the respawn location of any player who is leaving; this prevents\n\t-- a memory leak if potentially many players visit\n\trespawnLocations[player] = nil\nend\n\n-- Note that we're NOT using PlayerRemoving here, since CharacterRemoving fires\n-- AFTER PlayerRemoving, we don't want to forget the respawn location then instantly\n-- save another right after\nPlayers.PlayerAdded:Connect(onPlayerAdded)\nPlayers.ChildRemoved:Connect(onPlayerRemoved)", "expectedOutput": "", "highlightLines": "" }, { "identifier": "accessory-remover", "displayName": "Accessory Remover", "description": "This code sample automatically removes `Accessory` objects like hats from the\n`Player`'s character when they respawn. Warning: this includes hair, so this\nscript may cause acute baldness.\n\nWhen the `Class.Player.Character|Character()` is\n`Class.Player.CharacterAdded|added`, we wait for `Class.RunService.Stepped` to\nfire once (using the `wait` function of events). This is so the accessory\nremoval logic runs one frame after the character spawns. A warning can appear\nif you delete accessories too quickly after the player spawns, so waiting one\nframe will avoid that.\n", "codeSample": "local Players = game:GetService(\"Players\")\nlocal RunService = game:GetService(\"RunService\")\n\nlocal function destroyAccessory(object)\n\tif object:IsA(\"Hat\") or object:IsA(\"Accessory\") then\n\t\tobject:Destroy()\n\tend\nend\n\nlocal function onCharacterAdded(character)\n\t-- Wait a brief moment before removing accessories to avoid the\n\t-- \"Something unexpectedly set ___ parent to NULL\" warning\n\tRunService.Stepped:Wait()\n\t-- Check for any existing accessories in the player's character\n\tfor _, child in pairs(character:GetChildren()) do\n\t\tdestroyAccessory(child)\n\tend\n\t-- Hats may be added to the character a moment after\n\t-- CharacterAdded fires, so we listen for those using ChildAdded\n\tcharacter.ChildAdded:Connect(destroyAccessory)\nend\n\nlocal function onPlayerAdded(player)\n\tplayer.CharacterAdded:Connect(onCharacterAdded)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "character", "type": "Model", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "An instance of the character that spawned/respawned.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 53, "offset": 52 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 53, "offset": 52 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Player.CharacterAppearanceLoaded", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fires when the full appearance of a ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 37, "offset": 36 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 1, "column": 37, "offset": 36 }, "end": { "line": 1, "column": 61, "offset": 60 } } }, { "type": "text", "value": " has been\ninserted.", "position": { "start": { "line": 1, "column": 61, "offset": 60 }, "end": { "line": 2, "column": 10, "offset": 79 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 10, "offset": 79 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This event fires when the full appearance of a ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 48, "offset": 47 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 1, "column": 48, "offset": 47 }, "end": { "line": 1, "column": 72, "offset": 71 } } }, { "type": "text", "value": "\nhas been inserted.", "position": { "start": { "line": 1, "column": 72, "offset": 71 }, "end": { "line": 2, "column": 19, "offset": 90 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 19, "offset": 90 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A ", "position": { "start": { "line": 4, "column": 1, "offset": 92 }, "end": { "line": 4, "column": 3, "offset": 94 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 4, "column": 3, "offset": 94 }, "end": { "line": 4, "column": 27, "offset": 118 } } }, { "type": "text", "value": " generally has a range of objects modifying its\nappearance, including ", "position": { "start": { "line": 4, "column": 27, "offset": 118 }, "end": { "line": 5, "column": 23, "offset": 188 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Accoutrement|Accoutrements" } ], "position": { "start": { "line": 5, "column": 23, "offset": 188 }, "end": { "line": 5, "column": 57, "offset": 222 } } }, { "type": "text", "value": ",\n", "position": { "start": { "line": 5, "column": 57, "offset": 222 }, "end": { "line": 6, "column": 1, "offset": 224 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Shirt|Shirts" } ], "position": { "start": { "line": 6, "column": 1, "offset": 224 }, "end": { "line": 6, "column": 21, "offset": 244 } } }, { "type": "text", "value": ", ", "position": { "start": { "line": 6, "column": 21, "offset": 244 }, "end": { "line": 6, "column": 23, "offset": 246 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Pants" } ], "position": { "start": { "line": 6, "column": 23, "offset": 246 }, "end": { "line": 6, "column": 36, "offset": 259 } } }, { "type": "text", "value": " and\n", "position": { "start": { "line": 6, "column": 36, "offset": 259 }, "end": { "line": 7, "column": 1, "offset": 264 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.CharacterMesh|CharacterMeshes" } ], "position": { "start": { "line": 7, "column": 1, "offset": 264 }, "end": { "line": 7, "column": 38, "offset": 301 } } }, { "type": "text", "value": ". This event will fire when all such\nobjects have been inserted into the ", "position": { "start": { "line": 7, "column": 38, "offset": 301 }, "end": { "line": 8, "column": 37, "offset": 374 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 8, "column": 37, "offset": 374 }, "end": { "line": 8, "column": 61, "offset": 398 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 8, "column": 61, "offset": 398 }, "end": { "line": 8, "column": 62, "offset": 399 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 92 }, "end": { "line": 8, "column": 62, "offset": 399 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "One use for this event is to ensure all accessories have loaded before\ndestroying them. See below for an example of this.", "position": { "start": { "line": 10, "column": 1, "offset": 401 }, "end": { "line": 11, "column": 51, "offset": 522 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 401 }, "end": { "line": 11, "column": 51, "offset": 522 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "remove-accessories-after-loading", "displayName": "Remove Accessories After Loading", "description": "This code sample will wait for accessories to fully load, print out\nhow many there are, and then destroy them all.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAddedAsync(player)\n\tlocal connection = player.CharacterAppearanceLoaded:Connect(function(character)\n\t\t\t-- All accessories have loaded at this point\n\t\t\tlocal numAccessories = #character:GetAccessories()\n\t\t\tprint((\"Destroying %d accessories for %s\"):format(numAccessories, player.Name))\n\t\t\tlocal humanoid = character:FindFirstChildOfClass(\"Humanoid\")\n\t\t\thumanoid:RemoveAccessories()\n\tend)\n\n\t-- Make sure we disconnect our connection to the player after they leave\n\t-- to allow the player to get garbage collected\n\tplayer.AncestryChanged:Wait()\n\tconnection:Disconnect()\nend\n\nfor _, player in Players:GetPlayers() do\n\ttask.spawn(onPlayerAddedAsync, player)\nend\nPlayers.PlayerAdded:Connect(onPlayerAddedAsync)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "character", "type": "Model", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 29, "offset": 28 } } }, { "type": "text", "value": " ", "position": { "start": { "line": 1, "column": 29, "offset": 28 }, "end": { "line": 1, "column": 30, "offset": 29 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Model" } ], "position": { "start": { "line": 1, "column": 30, "offset": 29 }, "end": { "line": 1, "column": 43, "offset": 42 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 43, "offset": 42 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Player.CharacterRemoving", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fired right before a player's character is removed.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 52, "offset": 51 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 52, "offset": 51 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The CharacterRemoving event fires right before a player's character is\nremoved, such as when the player is respawning.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 48, "offset": 118 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 48, "offset": 118 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This event can be used alongside the ", "position": { "start": { "line": 4, "column": 1, "offset": 120 }, "end": { "line": 4, "column": 38, "offset": 157 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.CharacterAdded" } ], "position": { "start": { "line": 4, "column": 38, "offset": 157 }, "end": { "line": 4, "column": 67, "offset": 186 } } }, { "type": "text", "value": " event,\nwhich fires when a player's character spawns or respawns. For instance, if\nyou would like to print a message every time a player spawns and dies:", "position": { "start": { "line": 4, "column": 67, "offset": 186 }, "end": { "line": 6, "column": 71, "offset": 339 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 120 }, "end": { "line": 6, "column": 71, "offset": 339 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local Players = game:GetService(\"Players\")\n\nlocal function onCharacterSpawned(player)\n\tprint(player.Name .. \" is spawning\")\nend\n\nlocal function onCharacterDespawned(player)\n\tprint(player.Name .. \" is despawning\")\nend\n\nlocal function onPlayerAdded(player)\n\tplayer.CharacterAdded:Connect(function ()\n\t\tonCharacterDespawned(player)\n\tend)\n\tplayer.CharacterRemoving:Connect(function ()\n\t\tonCharacterDespawned(player)\n\tend)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)\n" } ], "position": { "start": { "line": 8, "column": 1, "offset": 341 }, "end": { "line": 29, "column": 4, "offset": 817 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 341 }, "end": { "line": 29, "column": 4, "offset": 817 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This event is only concerned with the ", "position": { "start": { "line": 31, "column": 1, "offset": 819 }, "end": { "line": 31, "column": 39, "offset": 857 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character|Character" } ], "position": { "start": { "line": 31, "column": 39, "offset": 857 }, "end": { "line": 31, "column": 73, "offset": 891 } } }, { "type": "text", "value": "\nof a ", "position": { "start": { "line": 31, "column": 73, "offset": 891 }, "end": { "line": 32, "column": 6, "offset": 897 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 32, "column": 6, "offset": 897 }, "end": { "line": 32, "column": 20, "offset": 911 } } }, { "type": "text", "value": ". If you instead need to track when a player\njoins/leaves the game, use the events ", "position": { "start": { "line": 32, "column": 20, "offset": 911 }, "end": { "line": 33, "column": 39, "offset": 994 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players.PlayerAdded" } ], "position": { "start": { "line": 33, "column": 39, "offset": 994 }, "end": { "line": 33, "column": 66, "offset": 1021 } } }, { "type": "text", "value": " and\n", "position": { "start": { "line": 33, "column": 66, "offset": 1021 }, "end": { "line": 34, "column": 1, "offset": 1026 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players.PlayerRemoving" } ], "position": { "start": { "line": 34, "column": 1, "offset": 1026 }, "end": { "line": 34, "column": 31, "offset": 1056 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 34, "column": 31, "offset": 1056 }, "end": { "line": 34, "column": 32, "offset": 1057 } } } ], "position": { "start": { "line": 31, "column": 1, "offset": 819 }, "end": { "line": 34, "column": 32, "offset": 1057 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-CharacterRemoving1", "displayName": "Player.CharacterRemoving", "description": "This example prints the name of the character being removed, followed by \"has\ndied\".\n\nFor instance, if Shedletsky's character was to die in-game, \"Shedletsky has\ndied.\" would be printed.\n", "codeSample": "game.Players.PlayerAdded:Connect(function(player)\n\tplayer.CharacterRemoving:Connect(function(character)\n\t\tprint(character.Name .. \" has died.\")\n\tend)\nend)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "character", "type": "Model", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "An instance of the character that is being removed.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 52, "offset": 51 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 52, "offset": 51 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Player.Chatted", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fires when a player chats in-game using Roblox's provided chat bar.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The Chatted event fires when a ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 32, "offset": 31 }, "end": { "line": 1, "column": 46, "offset": 45 } } }, { "type": "text", "value": " types a message and presses\nenter in Roblox's provided chat bar. This is done using some Lua bindings\nby the default chat script. You can prevent players from chatting by using\n", "position": { "start": { "line": 1, "column": 46, "offset": 45 }, "end": { "line": 4, "column": 1, "offset": 223 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StarterGui:SetCoreGuiEnabled()" } ], "position": { "start": { "line": 4, "column": 1, "offset": 223 }, "end": { "line": 4, "column": 39, "offset": 261 } } }, { "type": "text", "value": " and disabling the Chat\n", "position": { "start": { "line": 4, "column": 39, "offset": 261 }, "end": { "line": 5, "column": 1, "offset": 285 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Enum.CoreGuiType" } ], "position": { "start": { "line": 5, "column": 1, "offset": 285 }, "end": { "line": 5, "column": 19, "offset": 303 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 5, "column": 19, "offset": 303 }, "end": { "line": 5, "column": 20, "offset": 304 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 5, "column": 20, "offset": 304 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Chat Commands", "position": { "start": { "line": 7, "column": 6, "offset": 311 }, "end": { "line": 7, "column": 19, "offset": 324 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 306 }, "end": { "line": 7, "column": 19, "offset": 324 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Using this event and some string manipulation functions like\n", "position": { "start": { "line": 9, "column": 1, "offset": 326 }, "end": { "line": 10, "column": 1, "offset": 387 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Library.string.sub()" } ], "position": { "start": { "line": 10, "column": 1, "offset": 387 }, "end": { "line": 10, "column": 23, "offset": 409 } } }, { "type": "text", "value": " and ", "position": { "start": { "line": 10, "column": 23, "offset": 409 }, "end": { "line": 10, "column": 28, "offset": 414 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Library.string.lower()" } ], "position": { "start": { "line": 10, "column": 28, "offset": 414 }, "end": { "line": 10, "column": 52, "offset": 438 } } }, { "type": "text", "value": ", it is possible to\ncreate chat commands, even with arguments like player names. Usually,\ncommands are prefixed such as ", "position": { "start": { "line": 10, "column": 52, "offset": 438 }, "end": { "line": 12, "column": 31, "offset": 558 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "heal PlayerName" } ], "position": { "start": { "line": 12, "column": 31, "offset": 558 }, "end": { "line": 12, "column": 48, "offset": 575 } } }, { "type": "text", "value": ". To check for a prefix in\na string, use ", "position": { "start": { "line": 12, "column": 48, "offset": 575 }, "end": { "line": 13, "column": 15, "offset": 616 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Library.string.sub()" } ], "position": { "start": { "line": 13, "column": 15, "offset": 616 }, "end": { "line": 13, "column": 37, "offset": 638 } } }, { "type": "text", "value": " on the message to check a substring\nof the message: ", "position": { "start": { "line": 13, "column": 37, "offset": 638 }, "end": { "line": 14, "column": 17, "offset": 691 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "string.sub(message, 1, 6) == \"/heal \"" } ], "position": { "start": { "line": 14, "column": 17, "offset": 691 }, "end": { "line": 14, "column": 56, "offset": 730 } } }, { "type": "text", "value": " (note the\ninclusion of the space). Then, extract the rest of the command using\n", "position": { "start": { "line": 14, "column": 56, "offset": 730 }, "end": { "line": 16, "column": 1, "offset": 810 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Library.string.sub()" } ], "position": { "start": { "line": 16, "column": 1, "offset": 810 }, "end": { "line": 16, "column": 23, "offset": 832 } } }, { "type": "text", "value": " again: ", "position": { "start": { "line": 16, "column": 23, "offset": 832 }, "end": { "line": 16, "column": 31, "offset": 840 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "string.sub(message, 7)" } ], "position": { "start": { "line": 16, "column": 31, "offset": 840 }, "end": { "line": 16, "column": 55, "offset": 864 } } }, { "type": "text", "value": " will be equal to\nthe player name. Check if that player exists, and if so, perform the\ncommand's action (in this example, healing them). Check the code samples\nfor examples of chat commands.", "position": { "start": { "line": 16, "column": 55, "offset": 864 }, "end": { "line": 19, "column": 31, "offset": 1054 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 326 }, "end": { "line": 19, "column": 31, "offset": 1054 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Filtering", "position": { "start": { "line": 21, "column": 6, "offset": 1061 }, "end": { "line": 21, "column": 15, "offset": 1070 } } } ], "position": { "start": { "line": 21, "column": 1, "offset": 1056 }, "end": { "line": 21, "column": 15, "offset": 1070 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The message text fired with this event is ", "position": { "start": { "line": 23, "column": 1, "offset": 1072 }, "end": { "line": 23, "column": 43, "offset": 1114 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "unfiltered", "position": { "start": { "line": 23, "column": 45, "offset": 1116 }, "end": { "line": 23, "column": 55, "offset": 1126 } } } ], "position": { "start": { "line": 23, "column": 43, "offset": 1114 }, "end": { "line": 23, "column": 57, "offset": 1128 } } }, { "type": "text", "value": ". If you are\ndisplaying player input like chat to other players in any form, it must be\nfiltered using ", "position": { "start": { "line": 23, "column": 57, "offset": 1128 }, "end": { "line": 25, "column": 16, "offset": 1231 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Chat:FilterStringAsync()" } ], "position": { "start": { "line": 25, "column": 16, "offset": 1231 }, "end": { "line": 25, "column": 48, "offset": 1263 } } }, { "type": "text", "value": ". Keep this in mind when\ncreating your own chat systems; if your game does not properly filter chat\nit may have moderation action taken against it.", "position": { "start": { "line": 25, "column": 48, "offset": 1263 }, "end": { "line": 27, "column": 48, "offset": 1410 } } } ], "position": { "start": { "line": 23, "column": 1, "offset": 1072 }, "end": { "line": 27, "column": 48, "offset": 1410 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-Chatted1", "displayName": "Player.Chatted", "description": "Setting chatted for all players. There is an easy way to make the Chatted\nevent registered on all players. Simply use the `Class.Players.PlayerAdded`\nevent in combination with this event.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n\tlocal function onChatted(message)\n\t\t-- do stuff with message and player\n\t\tprint(message)\n\tend\n\n\tplayer.Chatted:Connect(onChatted)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" }, { "identifier": "Playing-Spectating-Teams", "displayName": "Playing/Spectating Teams", "description": "This code sample, although lengthy, is quite simple: detect when a player\nchats /play, then put them on the \"Playing\" team. When they die, move them\nback to the \"Spectating\" team.\n", "codeSample": "local Players = game:GetService(\"Players\")\nlocal Teams = game:GetService(\"Teams\")\n\nlocal teamPlaying = Teams.Playing\nlocal teamSpectators = Teams.Spectating\n\nlocal playCommand = \"/play\"\n\nlocal function play(player)\n\tplayer.Team = teamPlaying\n\tplayer.TeamColor = teamPlaying.TeamColor\n\t-- Respawn the player (moves them to spawn location)\n\tplayer:LoadCharacter()\nend\n\nlocal function onPlayerDied(player, _character)\n\t-- When someone dies, put them on the spectator team\n\tplayer.Team = teamSpectators\nend\n\nlocal function onPlayerSpawned(player, character)\n\tlocal human = character:WaitForChild(\"Humanoid\")\n\thuman.Died:Connect(function()\n\t\tonPlayerDied(player, character)\n\tend)\nend\n\nlocal function onPlayerChatted(player, message)\n\tif message:sub(1, playCommand:len()):lower() == playCommand then\n\t\tplay(player)\n\tend\nend\n\nlocal function onPlayerAdded(player)\n\tif player.Character then\n\t\tonPlayerSpawned(player, player.Character)\n\tend\n\tplayer.CharacterAdded:Connect(function()\n\t\tonPlayerSpawned(player, player.Character)\n\tend)\n\tplayer.Chatted:Connect(function(message, _recipient)\n\t\tonPlayerChatted(player, message)\n\tend)\nend\n\nfor _, player in pairs(Players:GetPlayers()) do\n\tonPlayerAdded(player)\nend\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" }, { "identifier": "Join-Team-Command", "displayName": "Join Team Command", "description": "This code sample allows any player to chat \"/jointeam \" where is\nthe name of a team. It uses string manipulation using string.sub and\nstring.lower to make the command case-insensitive and allow for partial\nmatches. For example, \"/jointeam red\" will match the team \"Red Robins\".\n", "codeSample": "local Players = game:GetService(\"Players\")\nlocal Teams = game:GetService(\"Teams\")\n\n-- Command to choose a team (note the trailing space)\nlocal joinCommand = \"/jointeam \"\n\nlocal function findTeamByName(name)\n\t-- First, check for the exact name of a team\n\tif Teams:FindFirstChild(name) then\n\t\treturn Teams[name]\n\tend\n\t-- Let's check for case-insensitive partial matches, like \"red\" for \"Red Robins\"\n\tfor _, team in pairs(Teams:GetChildren()) do\n\t\tif team.Name:sub(1, name:len()):lower() == name:lower() then\n\t\t\treturn team\n\t\tend\n\tend\n\t-- If we get to this point, no team matched the one we were looking for :(\nend\n\nlocal function onPlayerChatted(player, message, _recipient)\n\t-- Note: string.sub(message, ...) is the same as message:sub(...)\n\tif message:sub(1, joinCommand:len()):lower() == joinCommand:lower() then\n\t\t-- Matched \"/JOINTEAM xyz\" to our join command prefix \"/jointeam \"\n\t\tlocal teamName = message:sub(joinCommand:len() + 1) -- Cut out the \"xyz\" from \"/jointeam xyz\"\n\t\tlocal team = findTeamByName(teamName)\n\t\tif team then\n\t\t\t-- Set the team!\n\t\t\tplayer.Team = team\n\t\t\tplayer.Neutral = false\n\t\telse\n\t\t\t-- Tell the player that team could not be found :(\n\t\t\tplayer.Team = nil\n\t\t\tplayer.Neutral = true\n\t\tend\n\tend\nend\n\nlocal function onPlayerAdded(player)\n\tplayer.Chatted:Connect(function(...)\n\t\tonPlayerChatted(player, ...)\n\tend)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "message", "type": "string", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The content of the message the player typed in chat.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 53, "offset": 52 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 53, "offset": 52 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } }, { "name": "recipient", "type": "Player", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Deprecated.", "position": { "start": { "line": 1, "column": 3, "offset": 2 }, "end": { "line": 1, "column": 14, "offset": 13 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 16, "offset": 15 } } }, { "type": "text", "value": " For whisper messages, this was the Player who was the\nintended target of the chat message.", "position": { "start": { "line": 1, "column": 16, "offset": 15 }, "end": { "line": 2, "column": 37, "offset": 106 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 37, "offset": 106 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Player.Idled", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Usually fired two minutes after the game engine classes the player as\nidle. Time is the amount of seconds since this point.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 54, "offset": 123 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 54, "offset": 123 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This event is usually fired two minutes after the game engine classifies\nthe ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 5, "offset": 77 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player|player" } ], "position": { "start": { "line": 2, "column": 5, "offset": 77 }, "end": { "line": 2, "column": 26, "offset": 98 } } }, { "type": "text", "value": " as idle. Time is the amount of seconds since\nthis point.", "position": { "start": { "line": 2, "column": 26, "offset": 98 }, "end": { "line": 3, "column": 12, "offset": 155 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 12, "offset": 155 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This can be used to track when a player has been idled for approximately\ntwo minutes - which can be useful for implementing away from keyboard\n(AFK) features into a game.", "position": { "start": { "line": 5, "column": 1, "offset": 157 }, "end": { "line": 7, "column": 28, "offset": 327 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 157 }, "end": { "line": 7, "column": 28, "offset": 327 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When the game engine classifies a player as idle, this event is called\nafter two minutes. After every check, if the player is still idled, the\nevent will continue to fire until the check reveals the player is no\nlonger idle.", "position": { "start": { "line": 9, "column": 1, "offset": 329 }, "end": { "line": 12, "column": 13, "offset": 553 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 329 }, "end": { "line": 12, "column": 13, "offset": 553 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This event is used by Roblox to automatically disconnect players that have\nbeen idle for at least 20 minutes. If you would like to track when this\ndisconnect occurs, consider using ", "position": { "start": { "line": 14, "column": 1, "offset": 555 }, "end": { "line": 16, "column": 35, "offset": 736 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Players.PlayerRemoving" } ], "position": { "start": { "line": 16, "column": 35, "offset": 736 }, "end": { "line": 16, "column": 65, "offset": 766 } } }, { "type": "text", "value": " alongside\nthis event.", "position": { "start": { "line": 16, "column": 65, "offset": 766 }, "end": { "line": 17, "column": 12, "offset": 788 } } } ], "position": { "start": { "line": 14, "column": 1, "offset": 555 }, "end": { "line": 17, "column": 12, "offset": 788 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-Idled1", "displayName": "Player.Idled1", "description": "This example will print how long a player, named Player, has been idle for.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal function onPlayerAdded(player)\n\tlocal function onIdled(time)\n\t\tprint(\"Player has been idle for \" .. time .. \" seconds\")\n\tend\n\n\tplayer.Idled:Connect(onIdled)\nend\n\nPlayers.PlayerAdded:Connect(onPlayerAdded)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "time", "type": "double", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The time in seconds the player has been idle.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 46, "offset": 45 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 46, "offset": 45 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Player.OnTeleport", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fired when the TeleportState of a player changes.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 50, "offset": 49 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 50, "offset": 49 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fired when the TeleportState of a player changes. This event is useful for\ndetecting whether a teleportation was successful.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 50, "offset": 124 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 50, "offset": 124 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "What is the TeleportState?", "position": { "start": { "line": 4, "column": 6, "offset": 131 }, "end": { "line": 4, "column": 32, "offset": 157 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 126 }, "end": { "line": 4, "column": 32, "offset": 157 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When a teleportation request is made using ", "position": { "start": { "line": 6, "column": 1, "offset": 159 }, "end": { "line": 6, "column": 44, "offset": 202 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.TeleportService" } ], "position": { "start": { "line": 6, "column": 44, "offset": 202 }, "end": { "line": 6, "column": 67, "offset": 225 } } }, { "type": "text", "value": ", there\nare a series of stages before the ", "position": { "start": { "line": 6, "column": 67, "offset": 225 }, "end": { "line": 7, "column": 35, "offset": 267 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 7, "column": 35, "offset": 267 }, "end": { "line": 7, "column": 49, "offset": 281 } } }, { "type": "text", "value": " is teleported. The\ncurrent stage is represented by the ", "position": { "start": { "line": 7, "column": 49, "offset": 281 }, "end": { "line": 8, "column": 37, "offset": 337 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Enum.TeleportState" } ], "position": { "start": { "line": 8, "column": 37, "offset": 337 }, "end": { "line": 8, "column": 57, "offset": 357 } } }, { "type": "text", "value": " value which is\ngiven by OnTeleport. See below for a practical example of this.", "position": { "start": { "line": 8, "column": 57, "offset": 357 }, "end": { "line": 9, "column": 64, "offset": 436 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 159 }, "end": { "line": 9, "column": 64, "offset": 436 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Player-OnTeleport1", "displayName": "Player.OnTeleport", "description": "This example prints which stage of a teleport a player is at, as well as\nprinting if the teleport was a failure.\n", "codeSample": "local Players = game:GetService(\"Players\")\n\nPlayers.PlayerAdded:Connect(function(player)\n\tlocal playerOnTeleport = player\n\tplayer.OnTeleport:Connect(function(teleportState, _placeId, _spawnName)\n\t\tif teleportState == Enum.TeleportState.Started then\n\t\t\tprint(\"Teleport started (\" .. playerOnTeleport.Name .. \")\")\n\t\telseif teleportState == Enum.TeleportState.WaitingForServer then\n\t\t\tprint(\"Teleport waiting for server (\" .. playerOnTeleport.Name .. \")\")\n\t\telseif teleportState == Enum.TeleportState.InProgress then\n\t\t\tprint(\"Teleport in progress (\" .. playerOnTeleport.Name .. \")\")\n\t\telseif teleportState == Enum.TeleportState.Failed then\n\t\t\tprint(\"Teleport failed! (\" .. playerOnTeleport.Name .. \")\")\n\t\tend\n\tend)\nend)", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "teleportState", "type": "TeleportState", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The new ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 9, "offset": 8 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Enum.TeleportState" } ], "position": { "start": { "line": 1, "column": 9, "offset": 8 }, "end": { "line": 1, "column": 29, "offset": 28 } } }, { "type": "text", "value": " of the ", "position": { "start": { "line": 1, "column": 29, "offset": 28 }, "end": { "line": 1, "column": 37, "offset": 36 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 37, "offset": 36 }, "end": { "line": 1, "column": 51, "offset": 50 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 51, "offset": 50 }, "end": { "line": 1, "column": 52, "offset": 51 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 52, "offset": 51 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } }, { "name": "placeId", "type": "int64", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ID of the place the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 25, "offset": 24 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player" } ], "position": { "start": { "line": 1, "column": 25, "offset": 24 }, "end": { "line": 1, "column": 39, "offset": 38 } } }, { "type": "text", "value": " is being teleported to.", "position": { "start": { "line": 1, "column": 39, "offset": 38 }, "end": { "line": 1, "column": 63, "offset": 62 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 63, "offset": 62 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } }, { "name": "spawnName", "type": "string", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The name of the spawn to teleport to, if\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.TeleportService:TeleportToSpawnByName()" } ], "position": { "start": { "line": 2, "column": 1, "offset": 41 }, "end": { "line": 2, "column": 48, "offset": 88 } } }, { "type": "text", "value": " has been used.", "position": { "start": { "line": 2, "column": 48, "offset": 88 }, "end": { "line": 2, "column": 63, "offset": 103 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 63, "offset": 103 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" } ], "callbacks": [], "__typename": "ClassReference", "id": "Player", "slug": "Player" }, "classReferenceParents": [ { "name": "Instance", "type": "CLASS", "category": null, "memoryCategory": "Instances", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Instance is the base class for all classes in the Roblox class hierarchy.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 74, "offset": 73 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 74, "offset": 73 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Instance is the base class for all classes in the Roblox class hierarchy.\nEvery other class that the Roblox engine defines inherits all of the members\nof Instance. It is not possible to directly create Instance objects.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 69, "offset": 219 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 69, "offset": 219 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Instance has a special function called ", "position": { "start": { "line": 5, "column": 1, "offset": 221 }, "end": { "line": 5, "column": 40, "offset": 260 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Datatype.Instance.new()" } ], "position": { "start": { "line": 5, "column": 40, "offset": 260 }, "end": { "line": 5, "column": 65, "offset": 285 } } }, { "type": "text", "value": " which is used\nto create objects via code. This function takes the name of the class as a\nparameter and returns the created object. Abstract classes and services cannot\nbe created with the Instance.new function.", "position": { "start": { "line": 5, "column": 65, "offset": 285 }, "end": { "line": 8, "column": 43, "offset": 496 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 221 }, "end": { "line": 8, "column": 43, "offset": 496 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "inherits": [], "tags": [ "NOT_CREATABLE", "NOT_BROWSABLE" ], "deprecationMessage": "", "properties": [ { "name": "Instance.Archivable", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines if an ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 18, "offset": 17 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 18, "offset": 17 }, "end": { "line": 1, "column": 34, "offset": 33 } } }, { "type": "text", "value": " can be cloned using\n", "position": { "start": { "line": 1, "column": 34, "offset": 33 }, "end": { "line": 2, "column": 1, "offset": 54 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Clone()" } ], "position": { "start": { "line": 2, "column": 1, "offset": 54 }, "end": { "line": 2, "column": 25, "offset": 78 } } }, { "type": "text", "value": " or saved to file.", "position": { "start": { "line": 2, "column": 25, "offset": 78 }, "end": { "line": 2, "column": 43, "offset": 96 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 43, "offset": 96 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property determines whether an ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 37, "offset": 36 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance|object" } ], "position": { "start": { "line": 1, "column": 37, "offset": 36 }, "end": { "line": 1, "column": 60, "offset": 59 } } }, { "type": "text", "value": " should be\nincluded when the game is published or saved, or when\n", "position": { "start": { "line": 1, "column": 60, "offset": 59 }, "end": { "line": 3, "column": 1, "offset": 124 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Clone()" } ], "position": { "start": { "line": 3, "column": 1, "offset": 124 }, "end": { "line": 3, "column": 25, "offset": 148 } } }, { "type": "text", "value": " is called on one of the object's ancestors.\nCalling Clone directly on an object will return nil if the cloned object\nis not archivable. Copying an object in Studio (using the 'Duplicate' or\n'Copy' options) will ignore the Archivable property and set Archivable to\ntrue for the copy.", "position": { "start": { "line": 3, "column": 25, "offset": 148 }, "end": { "line": 7, "column": 19, "offset": 431 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 7, "column": 19, "offset": 431 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local part = Instance.new(\"Part\")\nprint(part:Clone()) --> Part\npart.Archivable = false\nprint(part:Clone()) --> nil\n" } ], "position": { "start": { "line": 9, "column": 1, "offset": 433 }, "end": { "line": 14, "column": 4, "offset": 557 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 433 }, "end": { "line": 14, "column": 4, "offset": 557 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "type": "bool", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Behavior", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Instance.ClassName", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A read-only string representing the class this ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 48, "offset": 47 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 48, "offset": 47 }, "end": { "line": 1, "column": 64, "offset": 63 } } }, { "type": "text", "value": " belongs\nto.", "position": { "start": { "line": 1, "column": 64, "offset": 63 }, "end": { "line": 2, "column": 4, "offset": 75 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 4, "offset": 75 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A read-only string representing the class this ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 48, "offset": 47 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 48, "offset": 47 }, "end": { "line": 1, "column": 64, "offset": 63 } } }, { "type": "text", "value": " belongs\nto.", "position": { "start": { "line": 1, "column": 64, "offset": 63 }, "end": { "line": 2, "column": 4, "offset": 75 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 4, "offset": 75 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property can be used with various other functions of Instance that\nare used to identify objects by type, such as ", "position": { "start": { "line": 4, "column": 1, "offset": 77 }, "end": { "line": 5, "column": 47, "offset": 195 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsA()" } ], "position": { "start": { "line": 5, "column": 47, "offset": 195 }, "end": { "line": 5, "column": 69, "offset": 217 } } }, { "type": "text", "value": " or\n", "position": { "start": { "line": 5, "column": 69, "offset": 217 }, "end": { "line": 6, "column": 1, "offset": 221 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstChildOfClass()" } ], "position": { "start": { "line": 6, "column": 1, "offset": 221 }, "end": { "line": 6, "column": 41, "offset": 261 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 6, "column": 41, "offset": 261 }, "end": { "line": 6, "column": 42, "offset": 262 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 77 }, "end": { "line": 6, "column": 42, "offset": 262 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note this property is read only and cannot be altered by scripts.\nDevelopers wishing to change an ", "position": { "start": { "line": 8, "column": 1, "offset": 264 }, "end": { "line": 9, "column": 33, "offset": 362 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 9, "column": 33, "offset": 362 }, "end": { "line": 9, "column": 49, "offset": 378 } } }, { "type": "text", "value": "'s class will instead have\nto create a new ", "position": { "start": { "line": 9, "column": 49, "offset": 378 }, "end": { "line": 10, "column": 17, "offset": 421 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 10, "column": 17, "offset": 421 }, "end": { "line": 10, "column": 33, "offset": 437 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 10, "column": 33, "offset": 437 }, "end": { "line": 10, "column": 34, "offset": 438 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 264 }, "end": { "line": 10, "column": 34, "offset": 438 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Unlike ", "position": { "start": { "line": 12, "column": 1, "offset": 440 }, "end": { "line": 12, "column": 8, "offset": 447 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsA()" } ], "position": { "start": { "line": 12, "column": 8, "offset": 447 }, "end": { "line": 12, "column": 30, "offset": 469 } } }, { "type": "text", "value": ", ClassName can be used to check if an object\nbelongs to a specific class ignoring class inheritance. For example:", "position": { "start": { "line": 12, "column": 30, "offset": 469 }, "end": { "line": 13, "column": 69, "offset": 583 } } } ], "position": { "start": { "line": 12, "column": 1, "offset": 440 }, "end": { "line": 13, "column": 69, "offset": 583 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "for _, child in ipairs(game.Workspace:GetChildren()) do\n if child.ClassName == \"Part\" then\n print(\"Found a Part\")\n -- will find Parts in model, but NOT TrussParts, WedgeParts, etc\n end\nend\n" } ], "position": { "start": { "line": 15, "column": 1, "offset": 585 }, "end": { "line": 22, "column": 4, "offset": 801 } } } ], "position": { "start": { "line": 15, "column": 1, "offset": 585 }, "end": { "line": 22, "column": 4, "offset": 801 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "type": "string", "tags": [ "READ_ONLY", "NOT_REPLICATED" ], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Instance.Name", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A non-unique identifier of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 32, "offset": 31 }, "end": { "line": 1, "column": 48, "offset": 47 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 48, "offset": 47 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A non-unique identifier of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 32, "offset": 31 }, "end": { "line": 1, "column": 48, "offset": 47 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 48, "offset": 47 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 49, "offset": 48 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property is an identifier that describes an object. Names are not\nnecessarily unique identifiers however; multiple children of an object may\nshare the same name. Names are used to keep the object hierarchy\norganized, along with allowing scripts to access specific objects.", "position": { "start": { "line": 3, "column": 1, "offset": 50 }, "end": { "line": 6, "column": 67, "offset": 327 } } } ], "position": { "start": { "line": 3, "column": 1, "offset": 50 }, "end": { "line": 6, "column": 67, "offset": 327 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The name of an object is often used to access the object through the data\nmodel hierarchy using the following methods:", "position": { "start": { "line": 8, "column": 1, "offset": 329 }, "end": { "line": 9, "column": 45, "offset": 447 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 329 }, "end": { "line": 9, "column": 45, "offset": 447 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local baseplate = workspace.Baseplate\nlocal baseplate = workspace[\"Baseplate\"]\nlocal baseplate = workspace:FindFirstChild(\"BasePlate\")\n" } ], "position": { "start": { "line": 11, "column": 1, "offset": 449 }, "end": { "line": 15, "column": 4, "offset": 591 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 449 }, "end": { "line": 15, "column": 4, "offset": 591 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "In order to make an object accessible using the dot operator, an object's\nName must follow a certain syntax. The objects name must start with an\nunderscore or letter. The rest of the name can only contain letters,\nnumbers, or underscores (no other special characters). If an objects name\ndoes not follow this syntax it will not be accessible using the dot\noperator and Lua will not interpret its name as an identifier.", "position": { "start": { "line": 17, "column": 1, "offset": 593 }, "end": { "line": 22, "column": 63, "offset": 1011 } } } ], "position": { "start": { "line": 17, "column": 1, "offset": 593 }, "end": { "line": 22, "column": 63, "offset": 1011 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If more than one object with the same name are siblings then any attempt\nto index an object by that name will return the only one of the objects\nfound similar to ", "position": { "start": { "line": 24, "column": 1, "offset": 1013 }, "end": { "line": 26, "column": 18, "offset": 1175 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstChild()" } ], "position": { "start": { "line": 26, "column": 18, "offset": 1175 }, "end": { "line": 26, "column": 51, "offset": 1208 } } }, { "type": "text", "value": ", but not always the\ndesired object. If a specific object needs to be accessed through code, it\nis recommended to give it a unique name, or guarantee that none of its\nsiblings share the same name as it.", "position": { "start": { "line": 26, "column": 51, "offset": 1208 }, "end": { "line": 29, "column": 36, "offset": 1410 } } } ], "position": { "start": { "line": 24, "column": 1, "offset": 1013 }, "end": { "line": 29, "column": 36, "offset": 1410 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note, a full name showing the instance's hierarchy can be obtained using\n", "position": { "start": { "line": 31, "column": 1, "offset": 1412 }, "end": { "line": 32, "column": 1, "offset": 1485 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetFullName()" } ], "position": { "start": { "line": 32, "column": 1, "offset": 1485 }, "end": { "line": 32, "column": 31, "offset": 1515 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 32, "column": 31, "offset": 1515 }, "end": { "line": 32, "column": 32, "offset": 1516 } } } ], "position": { "start": { "line": 31, "column": 1, "offset": 1412 }, "end": { "line": 32, "column": 32, "offset": 1516 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "type": "string", "tags": [], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": true, "canSave": true }, "__typename": "ClassProperty" }, { "name": "Instance.Parent", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Determines the hierarchical parent of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 43, "offset": 42 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 43, "offset": 42 }, "end": { "line": 1, "column": 59, "offset": 58 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 59, "offset": 58 }, "end": { "line": 1, "column": 60, "offset": 59 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 60, "offset": 59 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The Parent property determines the hierarchical parent of the\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 62 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 2, "column": 1, "offset": 62 }, "end": { "line": 2, "column": 17, "offset": 78 } } }, { "type": "text", "value": ". The following terminology is commonly used when talking\nabout how this property is set:", "position": { "start": { "line": 2, "column": 17, "offset": 78 }, "end": { "line": 3, "column": 32, "offset": 167 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 32, "offset": 167 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "An object is a ", "position": { "start": { "line": 5, "column": 3, "offset": 171 }, "end": { "line": 5, "column": 18, "offset": 186 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "child", "position": { "start": { "line": 5, "column": 20, "offset": 188 }, "end": { "line": 5, "column": 25, "offset": 193 } } } ], "position": { "start": { "line": 5, "column": 18, "offset": 186 }, "end": { "line": 5, "column": 27, "offset": 195 } } }, { "type": "text", "value": " (", "position": { "start": { "line": 5, "column": 27, "offset": 195 }, "end": { "line": 5, "column": 29, "offset": 197 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "parented to", "position": { "start": { "line": 5, "column": 31, "offset": 199 }, "end": { "line": 5, "column": 42, "offset": 210 } } } ], "position": { "start": { "line": 5, "column": 29, "offset": 197 }, "end": { "line": 5, "column": 44, "offset": 212 } } }, { "type": "text", "value": ") another object when its\nParent is set to that object.", "position": { "start": { "line": 5, "column": 44, "offset": 212 }, "end": { "line": 6, "column": 32, "offset": 269 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 169 }, "end": { "line": 6, "column": 32, "offset": 269 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 7, "column": 3, "offset": 272 }, "end": { "line": 7, "column": 7, "offset": 276 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "descendants", "position": { "start": { "line": 7, "column": 9, "offset": 278 }, "end": { "line": 7, "column": 20, "offset": 289 } } } ], "position": { "start": { "line": 7, "column": 7, "offset": 276 }, "end": { "line": 7, "column": 22, "offset": 291 } } }, { "type": "text", "value": " of an ", "position": { "start": { "line": 7, "column": 22, "offset": 291 }, "end": { "line": 7, "column": 29, "offset": 298 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 7, "column": 29, "offset": 298 }, "end": { "line": 7, "column": 45, "offset": 314 } } }, { "type": "text", "value": " are the children of that\nobject, plus the descendants of the children as well.", "position": { "start": { "line": 7, "column": 45, "offset": 314 }, "end": { "line": 8, "column": 56, "offset": 395 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 270 }, "end": { "line": 8, "column": 56, "offset": 395 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 9, "column": 3, "offset": 398 }, "end": { "line": 9, "column": 7, "offset": 402 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "ancestors", "position": { "start": { "line": 9, "column": 9, "offset": 404 }, "end": { "line": 9, "column": 18, "offset": 413 } } } ], "position": { "start": { "line": 9, "column": 7, "offset": 402 }, "end": { "line": 9, "column": 20, "offset": 415 } } }, { "type": "text", "value": " of an ", "position": { "start": { "line": 9, "column": 20, "offset": 415 }, "end": { "line": 9, "column": 27, "offset": 422 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 9, "column": 27, "offset": 422 }, "end": { "line": 9, "column": 43, "offset": 438 } } }, { "type": "text", "value": " are all the objects that the\nInstance is a descendant of.", "position": { "start": { "line": 9, "column": 43, "offset": 438 }, "end": { "line": 10, "column": 31, "offset": 498 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 396 }, "end": { "line": 10, "column": 31, "offset": 498 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 5, "column": 1, "offset": 169 }, "end": { "line": 10, "column": 31, "offset": 498 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "It is from this property that many other API members get their name, such\nas ", "position": { "start": { "line": 12, "column": 1, "offset": 500 }, "end": { "line": 13, "column": 4, "offset": 577 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetChildren()|GetChildren" } ], "position": { "start": { "line": 13, "column": 4, "offset": 577 }, "end": { "line": 13, "column": 46, "offset": 619 } } }, { "type": "text", "value": " and\n", "position": { "start": { "line": 13, "column": 46, "offset": 619 }, "end": { "line": 14, "column": 1, "offset": 624 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstChild()|FindFirstChild" } ], "position": { "start": { "line": 14, "column": 1, "offset": 624 }, "end": { "line": 14, "column": 49, "offset": 672 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 14, "column": 49, "offset": 672 }, "end": { "line": 14, "column": 50, "offset": 673 } } } ], "position": { "start": { "line": 12, "column": 1, "offset": 500 }, "end": { "line": 14, "column": 50, "offset": 673 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 16, "column": 1, "offset": 675 }, "end": { "line": 16, "column": 5, "offset": 679 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Remove()|Remove" } ], "position": { "start": { "line": 16, "column": 5, "offset": 679 }, "end": { "line": 16, "column": 37, "offset": 711 } } }, { "type": "text", "value": " function sets this property to nil.\nCalling ", "position": { "start": { "line": 16, "column": 37, "offset": 711 }, "end": { "line": 17, "column": 9, "offset": 756 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Destroy()|Destroy" } ], "position": { "start": { "line": 17, "column": 9, "offset": 756 }, "end": { "line": 17, "column": 43, "offset": 790 } } }, { "type": "text", "value": " will set the Parent of an\n", "position": { "start": { "line": 17, "column": 43, "offset": 790 }, "end": { "line": 18, "column": 1, "offset": 817 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 18, "column": 1, "offset": 817 }, "end": { "line": 18, "column": 17, "offset": 833 } } }, { "type": "text", "value": " and all of its descendants to ", "position": { "start": { "line": 18, "column": 17, "offset": 833 }, "end": { "line": 18, "column": 48, "offset": 864 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "nil" } ], "position": { "start": { "line": 18, "column": 48, "offset": 864 }, "end": { "line": 18, "column": 53, "offset": 869 } } }, { "type": "text", "value": ", and also ", "position": { "start": { "line": 18, "column": 53, "offset": 869 }, "end": { "line": 18, "column": 64, "offset": 880 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "lock", "position": { "start": { "line": 18, "column": 66, "offset": 882 }, "end": { "line": 18, "column": 70, "offset": 886 } } } ], "position": { "start": { "line": 18, "column": 64, "offset": 880 }, "end": { "line": 18, "column": 72, "offset": 888 } } }, { "type": "text", "value": "\nthe Parent property. An error is raised when setting the Parent of a\ndestroyed object.", "position": { "start": { "line": 18, "column": 72, "offset": 888 }, "end": { "line": 20, "column": 18, "offset": 975 } } } ], "position": { "start": { "line": 16, "column": 1, "offset": 675 }, "end": { "line": 20, "column": 18, "offset": 975 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property is also used to manage whether an object exists in the game\nor needs removed. As long as an objects parent is in the\n", "position": { "start": { "line": 22, "column": 1, "offset": 977 }, "end": { "line": 24, "column": 1, "offset": 1108 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataModel" } ], "position": { "start": { "line": 24, "column": 1, "offset": 1108 }, "end": { "line": 24, "column": 18, "offset": 1125 } } }, { "type": "text", "value": ", is stored in a variable, or is referenced by another\nobjects property, then the object remains in the game. Otherwise, the\nobject will automatically be removed. The top level ", "position": { "start": { "line": 24, "column": 18, "offset": 1125 }, "end": { "line": 26, "column": 53, "offset": 1302 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataModel" } ], "position": { "start": { "line": 26, "column": 53, "offset": 1302 }, "end": { "line": 26, "column": 70, "offset": 1319 } } }, { "type": "text", "value": "\nobject (the one referred to as the ", "position": { "start": { "line": 26, "column": 70, "offset": 1319 }, "end": { "line": 27, "column": 36, "offset": 1355 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "game" } ], "position": { "start": { "line": 27, "column": 36, "offset": 1355 }, "end": { "line": 27, "column": 42, "offset": 1361 } } }, { "type": "text", "value": " by scripts) has no parent, but\nalways has a reference held to it by the game engine, and exists for the\nduration of a session.", "position": { "start": { "line": 27, "column": 42, "offset": 1361 }, "end": { "line": 29, "column": 23, "offset": 1488 } } } ], "position": { "start": { "line": 22, "column": 1, "offset": 977 }, "end": { "line": 29, "column": 23, "offset": 1488 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Newly created objects using ", "position": { "start": { "line": 31, "column": 1, "offset": 1490 }, "end": { "line": 31, "column": 29, "offset": 1518 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Datatype.Instance.new()" } ], "position": { "start": { "line": 31, "column": 29, "offset": 1518 }, "end": { "line": 31, "column": 54, "offset": 1543 } } }, { "type": "text", "value": " will not have a\nparent, and usually will not be visible or function until one is set. The\nmost elementary creation of an object has two steps: creating the object,\nthen setting its parent.", "position": { "start": { "line": 31, "column": 54, "offset": 1543 }, "end": { "line": 34, "column": 25, "offset": 1732 } } } ], "position": { "start": { "line": 31, "column": 1, "offset": 1490 }, "end": { "line": 34, "column": 25, "offset": 1732 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "-- Create a part and parent it to the workspace\nlocal part = Instance.new(\"Part\")\npart.Parent = workspace\n-- Instance new can also take Parent as a second parameter\nInstance.new(\"NumberValue\", workspace)\n" } ], "position": { "start": { "line": 36, "column": 1, "offset": 1734 }, "end": { "line": 42, "column": 4, "offset": 1945 } } } ], "position": { "start": { "line": 36, "column": 1, "offset": 1734 }, "end": { "line": 42, "column": 4, "offset": 1945 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Object Replication", "position": { "start": { "line": 44, "column": 6, "offset": 1952 }, "end": { "line": 44, "column": 24, "offset": 1970 } } } ], "position": { "start": { "line": 44, "column": 1, "offset": 1947 }, "end": { "line": 44, "column": 24, "offset": 1970 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "An object created by server will not replicate to clients until it is\nparented to some object that is replicated. When creating an object then\nsetting many properties, it's recommended to ", "position": { "start": { "line": 46, "column": 1, "offset": 1972 }, "end": { "line": 48, "column": 46, "offset": 2160 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "set Parent last", "position": { "start": { "line": 48, "column": 48, "offset": 2162 }, "end": { "line": 48, "column": 63, "offset": 2177 } } } ], "position": { "start": { "line": 48, "column": 46, "offset": 2160 }, "end": { "line": 48, "column": 65, "offset": 2179 } } }, { "type": "text", "value": ". This\nensures the object replicates once, instead of replicating many property\nchanges.", "position": { "start": { "line": 48, "column": 65, "offset": 2179 }, "end": { "line": 50, "column": 9, "offset": 2267 } } } ], "position": { "start": { "line": 46, "column": 1, "offset": 1972 }, "end": { "line": 50, "column": 9, "offset": 2267 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local part = Instance.new(\"Part\") -- Avoid using the second parameter here\npart.Anchored = true\npart.BrickColor = BrickColor.new(\"Really red\")\n-- Potentially many other property changes could go here here...\n-- Always set parent last!\npart.Parent = workspace\n" } ], "position": { "start": { "line": 52, "column": 1, "offset": 2269 }, "end": { "line": 59, "column": 4, "offset": 2538 } } } ], "position": { "start": { "line": 52, "column": 1, "offset": 2269 }, "end": { "line": 59, "column": 4, "offset": 2538 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "However, if you were parenting your parts to a ", "position": { "start": { "line": 61, "column": 1, "offset": 2540 }, "end": { "line": 61, "column": 48, "offset": 2587 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Model" } ], "position": { "start": { "line": 61, "column": 48, "offset": 2587 }, "end": { "line": 61, "column": 61, "offset": 2600 } } }, { "type": "text", "value": " whose parent\nhasn't been set yet, then setting the parent first would not matter as the\nmodel would not have replicated yet.", "position": { "start": { "line": 61, "column": 61, "offset": 2600 }, "end": { "line": 63, "column": 37, "offset": 2725 } } } ], "position": { "start": { "line": 61, "column": 1, "offset": 2540 }, "end": { "line": 63, "column": 37, "offset": 2725 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "type": "Instance", "tags": [ "NOT_REPLICATED" ], "deprecationMessage": "", "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": true, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Instance.RobloxLocked", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A deprecated property that used to protect ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.CoreGui" } ], "position": { "start": { "line": 1, "column": 44, "offset": 43 }, "end": { "line": 1, "column": 59, "offset": 58 } } }, { "type": "text", "value": " objects.", "position": { "start": { "line": 1, "column": 59, "offset": 58 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property used to protect objects in the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 46, "offset": 45 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.CoreGui" } ], "position": { "start": { "line": 1, "column": 46, "offset": 45 }, "end": { "line": 1, "column": 61, "offset": 60 } } }, { "type": "text", "value": " service from\nbeing altered by users in an unauthorized manner. It has been deprecated\nand does not do anything.", "position": { "start": { "line": 1, "column": 61, "offset": 60 }, "end": { "line": 3, "column": 26, "offset": 172 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 26, "offset": 172 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "type": "bool", "tags": [ "HIDDEN" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This property is deprecated and does not do anything.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 54, "offset": 53 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 54, "offset": 53 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": { "read": "PLUGIN_SECURITY", "write": "PLUGIN_SECURITY" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Instance.archivable", "summary": "", "description": "", "codeSamples": null, "type": "bool", "tags": [ "HIDDEN", "NOT_REPLICATED", "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated property is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Archivable" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 69, "offset": 68 } } }, { "type": "text", "value": " which\nshould be used instead.", "position": { "start": { "line": 1, "column": 69, "offset": 68 }, "end": { "line": 2, "column": 24, "offset": 98 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 24, "offset": 98 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Behavior", "serialization": { "canLoad": true, "canSave": false }, "__typename": "ClassProperty" }, { "name": "Instance.className", "summary": "", "description": "", "codeSamples": null, "type": "string", "tags": [ "READ_ONLY", "NOT_REPLICATED", "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated property is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ClassName" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 68, "offset": 67 } } }, { "type": "text", "value": " which\nshould be used instead.", "position": { "start": { "line": 1, "column": 68, "offset": 67 }, "end": { "line": 2, "column": 24, "offset": 97 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 24, "offset": 97 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": { "read": "NONE", "write": "NONE" }, "threadSafety": "READ_SAFE", "category": "Data", "serialization": { "canLoad": false, "canSave": false }, "__typename": "ClassProperty" } ], "methods": [ { "name": "Instance:AddTag", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Applies a tag to the instance.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 31, "offset": 30 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 31, "offset": 30 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This method applies a tag to the instance, with no effect if the tag is\nalready applied. Successfully adding a tag will fire a signal created by\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 145 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.CollectionService:GetInstanceAddedSignal()" } ], "position": { "start": { "line": 3, "column": 1, "offset": 145 }, "end": { "line": 3, "column": 51, "offset": 195 } } }, { "type": "text", "value": " with the given tag.", "position": { "start": { "line": 3, "column": 51, "offset": 195 }, "end": { "line": 3, "column": 71, "offset": 215 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 71, "offset": 215 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note that when tagging an instance, it's common that some resources are\nused to give the tag its functionality, for example event connections or\ntables. To prevent memory leaks, it's a good idea to clean these up\n(disconnect, set to ", "position": { "start": { "line": 5, "column": 1, "offset": 217 }, "end": { "line": 8, "column": 21, "offset": 450 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "nil" } ], "position": { "start": { "line": 8, "column": 21, "offset": 450 }, "end": { "line": 8, "column": 26, "offset": 455 } } }, { "type": "text", "value": ", etc.) when no longer needed for a tag. Do this\nwhen calling ", "position": { "start": { "line": 8, "column": 26, "offset": 455 }, "end": { "line": 9, "column": 14, "offset": 517 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:RemoveTag()" } ], "position": { "start": { "line": 9, "column": 14, "offset": 517 }, "end": { "line": 9, "column": 42, "offset": 545 } } }, { "type": "text", "value": ", calling\n", "position": { "start": { "line": 9, "column": 42, "offset": 545 }, "end": { "line": 10, "column": 1, "offset": 555 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Destroy()" } ], "position": { "start": { "line": 10, "column": 1, "offset": 555 }, "end": { "line": 10, "column": 27, "offset": 581 } } }, { "type": "text", "value": ", or in a function connected to a signal\nreturned by ", "position": { "start": { "line": 10, "column": 27, "offset": 581 }, "end": { "line": 11, "column": 13, "offset": 634 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.CollectionService:GetInstanceRemovedSignal()" } ], "position": { "start": { "line": 11, "column": 13, "offset": 634 }, "end": { "line": 11, "column": 65, "offset": 686 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 11, "column": 65, "offset": 686 }, "end": { "line": 11, "column": 66, "offset": 687 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 217 }, "end": { "line": 11, "column": 66, "offset": 687 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [], "parameters": [ { "name": "tag", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:ClearAllChildren", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function destroys all of an ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 34, "offset": 33 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 34, "offset": 33 }, "end": { "line": 1, "column": 50, "offset": 49 } } }, { "type": "text", "value": "'s children.", "position": { "start": { "line": 1, "column": 50, "offset": 49 }, "end": { "line": 1, "column": 62, "offset": 61 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 62, "offset": 61 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function destroys all of an ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 34, "offset": 33 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 34, "offset": 33 }, "end": { "line": 1, "column": 50, "offset": 49 } } }, { "type": "text", "value": "'s children.", "position": { "start": { "line": 1, "column": 50, "offset": 49 }, "end": { "line": 1, "column": 62, "offset": 61 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 62, "offset": 61 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "As ", "position": { "start": { "line": 3, "column": 1, "offset": 63 }, "end": { "line": 3, "column": 4, "offset": 66 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Destroy()" } ], "position": { "start": { "line": 3, "column": 4, "offset": 66 }, "end": { "line": 3, "column": 30, "offset": 92 } } }, { "type": "text", "value": " also calls itself on the children of an\nobject it is used on, this function will destroy all descendants.", "position": { "start": { "line": 3, "column": 30, "offset": 92 }, "end": { "line": 4, "column": 66, "offset": 198 } } } ], "position": { "start": { "line": 3, "column": 1, "offset": 63 }, "end": { "line": 4, "column": 66, "offset": 198 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Alternatives to ClearAllChildren", "position": { "start": { "line": 6, "column": 6, "offset": 205 }, "end": { "line": 6, "column": 38, "offset": 237 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 200 }, "end": { "line": 6, "column": 38, "offset": 237 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If the developer does not wish to destroy all descendants, they should use\n", "position": { "start": { "line": 8, "column": 1, "offset": 239 }, "end": { "line": 9, "column": 1, "offset": 314 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetChildren()" } ], "position": { "start": { "line": 9, "column": 1, "offset": 314 }, "end": { "line": 9, "column": 31, "offset": 344 } } }, { "type": "text", "value": " or ", "position": { "start": { "line": 9, "column": 31, "offset": 344 }, "end": { "line": 9, "column": 35, "offset": 348 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetDescendants()" } ], "position": { "start": { "line": 9, "column": 35, "offset": 348 }, "end": { "line": 9, "column": 68, "offset": 381 } } }, { "type": "text", "value": " to\nloop through an object and select what to destroy. For example, the\nfollowing code sample will destroy all parts in an object.", "position": { "start": { "line": 9, "column": 68, "offset": 381 }, "end": { "line": 11, "column": 59, "offset": 511 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 239 }, "end": { "line": 11, "column": 59, "offset": 511 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "for _, instance in pairs(object:GetDescendants()) do\n\tif instance:IsA(\"BasePart\") then\n\t\tinstance:Destroy()\n\tend\nend\n" } ], "position": { "start": { "line": 13, "column": 1, "offset": 513 }, "end": { "line": 19, "column": 4, "offset": 637 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 513 }, "end": { "line": 19, "column": 4, "offset": 637 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-ClearAllChildren1", "displayName": "Instance:ClearAllChildren", "description": "This example creates a Part and adds a few sparkle objects to the part. Then\nit calls Part:ClearAllChildren() to remove all of the children.\n", "codeSample": "local part = Instance.new(\"Part\")\n\n-- add some sparkles\nfor _ = 1, 3 do\n\tlocal sparkles = Instance.new(\"Sparkles\")\n\tsparkles.Parent = part\nend\n\nprint(\"Part has\", #part:GetChildren(), \"children\")\n--> Part has 3 children\n\npart:ClearAllChildren()\n\nprint(\"Part has\", #part:GetChildren(), \"children\")\n--> Part has 0 children", "expectedOutput": "", "highlightLines": "" } ], "parameters": [], "returns": [ { "type": "void", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:Clone", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Create a copy of an object and all its descendants, ignoring objects that\nare not ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 9, "offset": 82 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Archivable|Archivable" } ], "position": { "start": { "line": 2, "column": 9, "offset": 82 }, "end": { "line": 2, "column": 47, "offset": 120 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 2, "column": 47, "offset": 120 }, "end": { "line": 2, "column": 48, "offset": 121 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 48, "offset": 121 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Clone", "position": { "start": { "line": 1, "column": 3, "offset": 2 }, "end": { "line": 1, "column": 8, "offset": 7 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 10, "offset": 9 } } }, { "type": "text", "value": " creates a copy of an object and all of its descendants, ignoring\nall objects that are not ", "position": { "start": { "line": 1, "column": 10, "offset": 9 }, "end": { "line": 2, "column": 26, "offset": 100 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Archivable|Archivable" } ], "position": { "start": { "line": 2, "column": 26, "offset": 100 }, "end": { "line": 2, "column": 64, "offset": 138 } } }, { "type": "text", "value": ". The copy\nof the root object is returned by this function and its\n", "position": { "start": { "line": 2, "column": 64, "offset": 138 }, "end": { "line": 4, "column": 1, "offset": 205 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent|Parent" } ], "position": { "start": { "line": 4, "column": 1, "offset": 205 }, "end": { "line": 4, "column": 31, "offset": 235 } } }, { "type": "text", "value": " is set to nil.", "position": { "start": { "line": 4, "column": 31, "offset": 235 }, "end": { "line": 4, "column": 46, "offset": 250 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 46, "offset": 250 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If a reference property such as ", "position": { "start": { "line": 6, "column": 1, "offset": 252 }, "end": { "line": 6, "column": 33, "offset": 284 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.ObjectValue.Value" } ], "position": { "start": { "line": 6, "column": 33, "offset": 284 }, "end": { "line": 6, "column": 58, "offset": 309 } } }, { "type": "text", "value": " is set in a\ncloned object, the value of the copy's property depends on original's\nvalue:", "position": { "start": { "line": 6, "column": 58, "offset": 309 }, "end": { "line": 8, "column": 7, "offset": 398 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 252 }, "end": { "line": 8, "column": 7, "offset": 398 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "If a reference property refers to an object that was ", "position": { "start": { "line": 10, "column": 3, "offset": 402 }, "end": { "line": 10, "column": 56, "offset": 455 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "also", "position": { "start": { "line": 10, "column": 58, "offset": 457 }, "end": { "line": 10, "column": 62, "offset": 461 } } } ], "position": { "start": { "line": 10, "column": 56, "offset": 455 }, "end": { "line": 10, "column": 64, "offset": 463 } } }, { "type": "text", "value": " cloned, an\n", "position": { "start": { "line": 10, "column": 64, "offset": 463 }, "end": { "line": 11, "column": 1, "offset": 475 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "internal reference", "position": { "start": { "line": 11, "column": 4, "offset": 478 }, "end": { "line": 11, "column": 22, "offset": 496 } } } ], "position": { "start": { "line": 11, "column": 3, "offset": 477 }, "end": { "line": 11, "column": 23, "offset": 497 } } }, { "type": "text", "value": ", the copy will refer to the copy.", "position": { "start": { "line": 11, "column": 23, "offset": 497 }, "end": { "line": 11, "column": 57, "offset": 531 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 400 }, "end": { "line": 11, "column": 57, "offset": 531 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "If a reference property refers to an object that was ", "position": { "start": { "line": 12, "column": 3, "offset": 534 }, "end": { "line": 12, "column": 56, "offset": 587 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "not", "position": { "start": { "line": 12, "column": 58, "offset": 589 }, "end": { "line": 12, "column": 61, "offset": 592 } } } ], "position": { "start": { "line": 12, "column": 56, "offset": 587 }, "end": { "line": 12, "column": 63, "offset": 594 } } }, { "type": "text", "value": " cloned, an\n", "position": { "start": { "line": 12, "column": 63, "offset": 594 }, "end": { "line": 13, "column": 1, "offset": 606 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "external reference", "position": { "start": { "line": 13, "column": 4, "offset": 609 }, "end": { "line": 13, "column": 22, "offset": 627 } } } ], "position": { "start": { "line": 13, "column": 3, "offset": 608 }, "end": { "line": 13, "column": 23, "offset": 628 } } }, { "type": "text", "value": ", the same value is maintained in the copy.", "position": { "start": { "line": 13, "column": 23, "offset": 628 }, "end": { "line": 13, "column": 66, "offset": 671 } } } ], "position": { "start": { "line": 12, "column": 1, "offset": 532 }, "end": { "line": 13, "column": 66, "offset": 671 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 10, "column": 1, "offset": 400 }, "end": { "line": 13, "column": 66, "offset": 671 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function is typically used to create models that can be regenerated.\nFirst, get a reference to the original object. Then, make a copy of the\nobject and insert the copy by setting its ", "position": { "start": { "line": 15, "column": 1, "offset": 673 }, "end": { "line": 17, "column": 43, "offset": 861 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent|Parent" } ], "position": { "start": { "line": 17, "column": 43, "offset": 861 }, "end": { "line": 17, "column": 73, "offset": 891 } } }, { "type": "text", "value": "\nto the ", "position": { "start": { "line": 17, "column": 73, "offset": 891 }, "end": { "line": 18, "column": 8, "offset": 899 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Workspace" } ], "position": { "start": { "line": 18, "column": 8, "offset": 899 }, "end": { "line": 18, "column": 25, "offset": 916 } } }, { "type": "text", "value": " or one of its descendants. Finally, when it's\ntime to regenerate the model, ", "position": { "start": { "line": 18, "column": 25, "offset": 916 }, "end": { "line": 19, "column": 31, "offset": 993 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Destroy()|Destroy" } ], "position": { "start": { "line": 19, "column": 31, "offset": 993 }, "end": { "line": 19, "column": 65, "offset": 1027 } } }, { "type": "text", "value": " the copy\nand clone a new one from the original like before.", "position": { "start": { "line": 19, "column": 65, "offset": 1027 }, "end": { "line": 20, "column": 51, "offset": 1087 } } } ], "position": { "start": { "line": 15, "column": 1, "offset": 673 }, "end": { "line": 20, "column": 51, "offset": 1087 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Clone-Example", "displayName": "Clone Example", "description": "This code first references an existing object in the `original` variable.\nThen, it makes a copy of the object, sets the parent to that of the original,\nand finally moves the copy to (0, 50, 0).\n", "codeSample": "-- Get a reference to an existing object\nlocal original = workspace.Model\n-- Create the model copy\nlocal copy = original:Clone()\n-- Parent the copy to the same parent as the original\ncopy.Parent = original.Parent\n-- Move the copy so it's not overlapping the original\ncopy:SetPrimaryPartCFrame(CFrame.new(0, 50, 0))", "expectedOutput": "", "highlightLines": "" } ], "parameters": [], "returns": [ { "type": "Instance", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:Destroy", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Sets the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 10, "offset": 9 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 1, "column": 10, "offset": 9 }, "end": { "line": 1, "column": 33, "offset": 32 } } }, { "type": "text", "value": " property to nil, locks the\n", "position": { "start": { "line": 1, "column": 33, "offset": 32 }, "end": { "line": 2, "column": 1, "offset": 60 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 2, "column": 1, "offset": 60 }, "end": { "line": 2, "column": 24, "offset": 83 } } }, { "type": "text", "value": " property, disconnects all connections, and calls\nDestroy on all children.", "position": { "start": { "line": 2, "column": 24, "offset": 83 }, "end": { "line": 3, "column": 25, "offset": 157 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 25, "offset": 157 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Sets the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 10, "offset": 9 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 1, "column": 10, "offset": 9 }, "end": { "line": 1, "column": 33, "offset": 32 } } }, { "type": "text", "value": " property to nil, locks the\n", "position": { "start": { "line": 1, "column": 33, "offset": 32 }, "end": { "line": 2, "column": 1, "offset": 60 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 2, "column": 1, "offset": 60 }, "end": { "line": 2, "column": 24, "offset": 83 } } }, { "type": "text", "value": " property, disconnects all connections, and calls\nDestroy on all children. This function is the correct way to dispose of\nobjects that are no longer required. Disposing of unneeded objects is\nimportant, since unnecessary objects and connections in a place use up\nmemory (this is called a ", "position": { "start": { "line": 2, "column": 24, "offset": 83 }, "end": { "line": 6, "column": 26, "offset": 371 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "memory leak", "position": { "start": { "line": 6, "column": 28, "offset": 373 }, "end": { "line": 6, "column": 39, "offset": 384 } } } ], "position": { "start": { "line": 6, "column": 26, "offset": 371 }, "end": { "line": 6, "column": 41, "offset": 386 } } }, { "type": "text", "value": ") which can lead to serious\nperformance issues over time.", "position": { "start": { "line": 6, "column": 41, "offset": 386 }, "end": { "line": 7, "column": 30, "offset": 443 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 7, "column": 30, "offset": 443 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Tip:", "position": { "start": { "line": 9, "column": 3, "offset": 447 }, "end": { "line": 9, "column": 7, "offset": 451 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 445 }, "end": { "line": 9, "column": 9, "offset": 453 } } }, { "type": "text", "value": " After calling Destroy on an object, set any variables referencing\nthe object (or its descendants) to nil. This prevents your code from\naccessing anything to do with the object.", "position": { "start": { "line": 9, "column": 9, "offset": 453 }, "end": { "line": 11, "column": 42, "offset": 630 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 445 }, "end": { "line": 11, "column": 42, "offset": 630 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local part = Instance.new(\"Part\")\npart.Name = \"Hello, world\"\npart:Destroy()\n-- Don't do this:\nprint(part.Name) --> \"Hello, world\"\n-- Do this to prevent the above line from working:\npart = nil\n" } ], "position": { "start": { "line": 13, "column": 1, "offset": 632 }, "end": { "line": 21, "column": 4, "offset": 834 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 632 }, "end": { "line": 21, "column": 4, "offset": 834 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Once an ", "position": { "start": { "line": 23, "column": 1, "offset": 836 }, "end": { "line": 23, "column": 9, "offset": 844 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 23, "column": 9, "offset": 844 }, "end": { "line": 23, "column": 25, "offset": 860 } } }, { "type": "text", "value": " has been destroyed by this method it cannot be\nreused because the ", "position": { "start": { "line": 23, "column": 25, "offset": 860 }, "end": { "line": 24, "column": 20, "offset": 927 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 24, "column": 20, "offset": 927 }, "end": { "line": 24, "column": 43, "offset": 950 } } }, { "type": "text", "value": " property is locked. To\ntemporarily remove an object, set ", "position": { "start": { "line": 24, "column": 43, "offset": 950 }, "end": { "line": 25, "column": 35, "offset": 1008 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent|Parent" } ], "position": { "start": { "line": 25, "column": 35, "offset": 1008 }, "end": { "line": 25, "column": 65, "offset": 1038 } } }, { "type": "text", "value": " it to nil\ninstead. For example:", "position": { "start": { "line": 25, "column": 65, "offset": 1038 }, "end": { "line": 26, "column": 22, "offset": 1070 } } } ], "position": { "start": { "line": 23, "column": 1, "offset": 836 }, "end": { "line": 26, "column": 22, "offset": 1070 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "object.Parent = nil\nwait(2)\nobject.Parent = workspace\n" } ], "position": { "start": { "line": 28, "column": 1, "offset": 1072 }, "end": { "line": 32, "column": 4, "offset": 1133 } } } ], "position": { "start": { "line": 28, "column": 1, "offset": 1072 }, "end": { "line": 32, "column": 4, "offset": 1133 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "To Destroy an object after a set amount of time, use\n", "position": { "start": { "line": 34, "column": 1, "offset": 1135 }, "end": { "line": 35, "column": 1, "offset": 1188 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Debris:AddItem()" } ], "position": { "start": { "line": 35, "column": 1, "offset": 1188 }, "end": { "line": 35, "column": 25, "offset": 1212 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 35, "column": 25, "offset": 1212 }, "end": { "line": 35, "column": 26, "offset": 1213 } } } ], "position": { "start": { "line": 34, "column": 1, "offset": 1135 }, "end": { "line": 35, "column": 26, "offset": 1213 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-Destroy1", "displayName": "Instance:Destroy", "description": "", "codeSample": "local Part = workspace.Part\n\nPart:Destroy()\n\nPart.Parent = workspace --> The Parent property of Part is locked", "expectedOutput": "", "highlightLines": "" } ], "parameters": [], "returns": [ { "type": "void", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:FindFirstAncestor", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first ancestor of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 35, "offset": 34 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 35, "offset": 34 }, "end": { "line": 1, "column": 51, "offset": 50 } } }, { "type": "text", "value": " whose\n", "position": { "start": { "line": 1, "column": 51, "offset": 50 }, "end": { "line": 2, "column": 1, "offset": 57 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name" } ], "position": { "start": { "line": 2, "column": 1, "offset": 57 }, "end": { "line": 2, "column": 22, "offset": 78 } } }, { "type": "text", "value": " is equal to the given name.", "position": { "start": { "line": 2, "column": 22, "offset": 78 }, "end": { "line": 2, "column": 50, "offset": 106 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 50, "offset": 106 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first ancestor of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 35, "offset": 34 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 35, "offset": 34 }, "end": { "line": 1, "column": 51, "offset": 50 } } }, { "type": "text", "value": " whose\n", "position": { "start": { "line": 1, "column": 51, "offset": 50 }, "end": { "line": 2, "column": 1, "offset": 57 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name" } ], "position": { "start": { "line": 2, "column": 1, "offset": 57 }, "end": { "line": 2, "column": 22, "offset": 78 } } }, { "type": "text", "value": " is equal to the given name.", "position": { "start": { "line": 2, "column": 22, "offset": 78 }, "end": { "line": 2, "column": 50, "offset": 106 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 50, "offset": 106 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function works upwards, meaning it starts at the ", "position": { "start": { "line": 4, "column": 1, "offset": 108 }, "end": { "line": 4, "column": 55, "offset": 162 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 4, "column": 55, "offset": 162 }, "end": { "line": 4, "column": 71, "offset": 178 } } }, { "type": "text", "value": "'s\nimmediate ", "position": { "start": { "line": 4, "column": 71, "offset": 178 }, "end": { "line": 5, "column": 11, "offset": 191 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 5, "column": 11, "offset": 191 }, "end": { "line": 5, "column": 34, "offset": 214 } } }, { "type": "text", "value": " and works up towards the\n", "position": { "start": { "line": 5, "column": 34, "offset": 214 }, "end": { "line": 6, "column": 1, "offset": 240 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataModel" } ], "position": { "start": { "line": 6, "column": 1, "offset": 240 }, "end": { "line": 6, "column": 18, "offset": 257 } } }, { "type": "text", "value": ". If no matching ancestor is found, it returns nil.", "position": { "start": { "line": 6, "column": 18, "offset": 257 }, "end": { "line": 6, "column": 69, "offset": 308 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 108 }, "end": { "line": 6, "column": 69, "offset": 308 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The following code snippet would find the first ancestor of the object\nnamed 'Car'.", "position": { "start": { "line": 8, "column": 1, "offset": 310 }, "end": { "line": 9, "column": 13, "offset": 393 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 310 }, "end": { "line": 9, "column": 13, "offset": 393 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local car = object:FindFirstAncestor(\"Car\")\n" } ], "position": { "start": { "line": 11, "column": 1, "offset": 395 }, "end": { "line": 13, "column": 4, "offset": 446 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 395 }, "end": { "line": 13, "column": 4, "offset": 446 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "For variants of this function that find ancestors of a specific class,\nplease see ", "position": { "start": { "line": 15, "column": 1, "offset": 448 }, "end": { "line": 16, "column": 12, "offset": 530 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstAncestorOfClass()" } ], "position": { "start": { "line": 16, "column": 12, "offset": 530 }, "end": { "line": 16, "column": 55, "offset": 573 } } }, { "type": "text", "value": " and\n", "position": { "start": { "line": 16, "column": 55, "offset": 573 }, "end": { "line": 17, "column": 1, "offset": 578 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstAncestorWhichIsA()" } ], "position": { "start": { "line": 17, "column": 1, "offset": 578 }, "end": { "line": 17, "column": 45, "offset": 622 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 17, "column": 45, "offset": 622 }, "end": { "line": 17, "column": 46, "offset": 623 } } } ], "position": { "start": { "line": 15, "column": 1, "offset": 448 }, "end": { "line": 17, "column": 46, "offset": 623 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "name", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 26, "offset": 25 } } }, { "type": "text", "value": " to be looked for.", "position": { "start": { "line": 1, "column": 26, "offset": 25 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "Instance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " found.", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:FindFirstAncestorOfClass", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first ancestor of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 35, "offset": 34 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 35, "offset": 34 }, "end": { "line": 1, "column": 51, "offset": 50 } } }, { "type": "text", "value": " whose\n", "position": { "start": { "line": 1, "column": 51, "offset": 50 }, "end": { "line": 2, "column": 1, "offset": 57 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ClassName" } ], "position": { "start": { "line": 2, "column": 1, "offset": 57 }, "end": { "line": 2, "column": 27, "offset": 83 } } }, { "type": "text", "value": " is equal to the given className.", "position": { "start": { "line": 2, "column": 27, "offset": 83 }, "end": { "line": 2, "column": 60, "offset": 116 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 60, "offset": 116 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first ancestor of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 35, "offset": 34 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 35, "offset": 34 }, "end": { "line": 1, "column": 51, "offset": 50 } } }, { "type": "text", "value": " whose\n", "position": { "start": { "line": 1, "column": 51, "offset": 50 }, "end": { "line": 2, "column": 1, "offset": 57 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ClassName" } ], "position": { "start": { "line": 2, "column": 1, "offset": 57 }, "end": { "line": 2, "column": 27, "offset": 83 } } }, { "type": "text", "value": " is equal to the given className.", "position": { "start": { "line": 2, "column": 27, "offset": 83 }, "end": { "line": 2, "column": 60, "offset": 116 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 60, "offset": 116 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function works upwards, meaning it starts at the ", "position": { "start": { "line": 4, "column": 1, "offset": 118 }, "end": { "line": 4, "column": 55, "offset": 172 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 4, "column": 55, "offset": 172 }, "end": { "line": 4, "column": 71, "offset": 188 } } }, { "type": "text", "value": "'s\nimmediate ", "position": { "start": { "line": 4, "column": 71, "offset": 188 }, "end": { "line": 5, "column": 11, "offset": 201 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 5, "column": 11, "offset": 201 }, "end": { "line": 5, "column": 34, "offset": 224 } } }, { "type": "text", "value": " and works up towards the\n", "position": { "start": { "line": 5, "column": 34, "offset": 224 }, "end": { "line": 6, "column": 1, "offset": 250 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataModel" } ], "position": { "start": { "line": 6, "column": 1, "offset": 250 }, "end": { "line": 6, "column": 18, "offset": 267 } } }, { "type": "text", "value": ". If no matching ancestor is found, it returns nil.", "position": { "start": { "line": 6, "column": 18, "offset": 267 }, "end": { "line": 6, "column": 69, "offset": 318 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 118 }, "end": { "line": 6, "column": 69, "offset": 318 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A common use of this function is finding the ", "position": { "start": { "line": 8, "column": 1, "offset": 320 }, "end": { "line": 8, "column": 46, "offset": 365 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Model" } ], "position": { "start": { "line": 8, "column": 46, "offset": 365 }, "end": { "line": 8, "column": 59, "offset": 378 } } }, { "type": "text", "value": " a\n", "position": { "start": { "line": 8, "column": 59, "offset": 378 }, "end": { "line": 9, "column": 1, "offset": 381 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.BasePart" } ], "position": { "start": { "line": 9, "column": 1, "offset": 381 }, "end": { "line": 9, "column": 17, "offset": 397 } } }, { "type": "text", "value": " belongs to. For example:", "position": { "start": { "line": 9, "column": 17, "offset": 397 }, "end": { "line": 9, "column": 42, "offset": 422 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 320 }, "end": { "line": 9, "column": 42, "offset": 422 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local model = part:FindFirstAncestorOfClass(\"Model\")\n" } ], "position": { "start": { "line": 11, "column": 1, "offset": 424 }, "end": { "line": 13, "column": 4, "offset": 484 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 424 }, "end": { "line": 13, "column": 4, "offset": 484 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function is a variant of ", "position": { "start": { "line": 15, "column": 1, "offset": 486 }, "end": { "line": 15, "column": 31, "offset": 516 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstAncestor()" } ], "position": { "start": { "line": 15, "column": 31, "offset": 516 }, "end": { "line": 15, "column": 67, "offset": 552 } } }, { "type": "text", "value": " which\nchecks the ", "position": { "start": { "line": 15, "column": 67, "offset": 552 }, "end": { "line": 16, "column": 12, "offset": 570 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ClassName" } ], "position": { "start": { "line": 16, "column": 12, "offset": 570 }, "end": { "line": 16, "column": 38, "offset": 596 } } }, { "type": "text", "value": " property rather than\n", "position": { "start": { "line": 16, "column": 38, "offset": 596 }, "end": { "line": 17, "column": 1, "offset": 618 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name" } ], "position": { "start": { "line": 17, "column": 1, "offset": 618 }, "end": { "line": 17, "column": 22, "offset": 639 } } }, { "type": "text", "value": ". ", "position": { "start": { "line": 17, "column": 22, "offset": 639 }, "end": { "line": 17, "column": 24, "offset": 641 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstAncestorWhichIsA()" } ], "position": { "start": { "line": 17, "column": 24, "offset": 641 }, "end": { "line": 17, "column": 68, "offset": 685 } } }, { "type": "text", "value": " also\nexists, using the ", "position": { "start": { "line": 17, "column": 68, "offset": 685 }, "end": { "line": 18, "column": 19, "offset": 709 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsA()" } ], "position": { "start": { "line": 18, "column": 19, "offset": 709 }, "end": { "line": 18, "column": 41, "offset": 731 } } }, { "type": "text", "value": " method instead to respect class\ninheritance.", "position": { "start": { "line": 18, "column": 41, "offset": 731 }, "end": { "line": 19, "column": 13, "offset": 776 } } } ], "position": { "start": { "line": 15, "column": 1, "offset": 486 }, "end": { "line": 19, "column": 13, "offset": 776 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "className", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ClassName" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 31, "offset": 30 } } }, { "type": "text", "value": " to be looked for.", "position": { "start": { "line": 1, "column": 31, "offset": 30 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "Instance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " found.", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:FindFirstAncestorWhichIsA", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first ancestor of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 35, "offset": 34 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 35, "offset": 34 }, "end": { "line": 1, "column": 51, "offset": 50 } } }, { "type": "text", "value": " for whom\n", "position": { "start": { "line": 1, "column": 51, "offset": 50 }, "end": { "line": 2, "column": 1, "offset": 60 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsA()" } ], "position": { "start": { "line": 2, "column": 1, "offset": 60 }, "end": { "line": 2, "column": 23, "offset": 82 } } }, { "type": "text", "value": " returns true for the given className.", "position": { "start": { "line": 2, "column": 23, "offset": 82 }, "end": { "line": 2, "column": 61, "offset": 120 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 61, "offset": 120 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first ancestor of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 35, "offset": 34 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 35, "offset": 34 }, "end": { "line": 1, "column": 51, "offset": 50 } } }, { "type": "text", "value": " for whom\n", "position": { "start": { "line": 1, "column": 51, "offset": 50 }, "end": { "line": 2, "column": 1, "offset": 60 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsA()" } ], "position": { "start": { "line": 2, "column": 1, "offset": 60 }, "end": { "line": 2, "column": 23, "offset": 82 } } }, { "type": "text", "value": " returns true for the given className.", "position": { "start": { "line": 2, "column": 23, "offset": 82 }, "end": { "line": 2, "column": 61, "offset": 120 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 61, "offset": 120 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function works upwards, meaning it starts at the ", "position": { "start": { "line": 4, "column": 1, "offset": 122 }, "end": { "line": 4, "column": 55, "offset": 176 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 4, "column": 55, "offset": 176 }, "end": { "line": 4, "column": 71, "offset": 192 } } }, { "type": "text", "value": "'s\nimmediate ", "position": { "start": { "line": 4, "column": 71, "offset": 192 }, "end": { "line": 5, "column": 11, "offset": 205 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 5, "column": 11, "offset": 205 }, "end": { "line": 5, "column": 34, "offset": 228 } } }, { "type": "text", "value": " and works up towards the\n", "position": { "start": { "line": 5, "column": 34, "offset": 228 }, "end": { "line": 6, "column": 1, "offset": 254 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataModel" } ], "position": { "start": { "line": 6, "column": 1, "offset": 254 }, "end": { "line": 6, "column": 18, "offset": 271 } } }, { "type": "text", "value": ". If no matching ancestor is found, it returns nil.", "position": { "start": { "line": 6, "column": 18, "offset": 271 }, "end": { "line": 6, "column": 69, "offset": 322 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 122 }, "end": { "line": 6, "column": 69, "offset": 322 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Unlike ", "position": { "start": { "line": 8, "column": 1, "offset": 324 }, "end": { "line": 8, "column": 8, "offset": 331 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstAncestorOfClass()" } ], "position": { "start": { "line": 8, "column": 8, "offset": 331 }, "end": { "line": 8, "column": 51, "offset": 374 } } }, { "type": "text", "value": ", this function uses\n", "position": { "start": { "line": 8, "column": 51, "offset": 374 }, "end": { "line": 9, "column": 1, "offset": 395 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsA()" } ], "position": { "start": { "line": 9, "column": 1, "offset": 395 }, "end": { "line": 9, "column": 23, "offset": 417 } } }, { "type": "text", "value": " which respects class inheritance. For example:", "position": { "start": { "line": 9, "column": 23, "offset": 417 }, "end": { "line": 9, "column": 70, "offset": 464 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 324 }, "end": { "line": 9, "column": 70, "offset": 464 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "print(part:IsA(\"Part\")) --> true\nprint(part:IsA(\"BasePart\")) --> true\nprint(part:IsA(\"Instance\")) --> true\n" } ], "position": { "start": { "line": 11, "column": 1, "offset": 466 }, "end": { "line": 15, "column": 4, "offset": 583 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 466 }, "end": { "line": 15, "column": 4, "offset": 583 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Therefore, the following code sample will return the first\n", "position": { "start": { "line": 17, "column": 1, "offset": 585 }, "end": { "line": 18, "column": 1, "offset": 644 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.BasePart" } ], "position": { "start": { "line": 18, "column": 1, "offset": 644 }, "end": { "line": 18, "column": 17, "offset": 660 } } }, { "type": "text", "value": " ancestor, regardless of if it is a ", "position": { "start": { "line": 18, "column": 17, "offset": 660 }, "end": { "line": 18, "column": 53, "offset": 696 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.WedgePart" } ], "position": { "start": { "line": 18, "column": 53, "offset": 696 }, "end": { "line": 18, "column": 70, "offset": 713 } } }, { "type": "text", "value": ",\n", "position": { "start": { "line": 18, "column": 70, "offset": 713 }, "end": { "line": 19, "column": 1, "offset": 715 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.MeshPart" } ], "position": { "start": { "line": 19, "column": 1, "offset": 715 }, "end": { "line": 19, "column": 17, "offset": 731 } } }, { "type": "text", "value": " or ", "position": { "start": { "line": 19, "column": 17, "offset": 731 }, "end": { "line": 19, "column": 21, "offset": 735 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Part" } ], "position": { "start": { "line": 19, "column": 21, "offset": 735 }, "end": { "line": 19, "column": 33, "offset": 747 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 19, "column": 33, "offset": 747 }, "end": { "line": 19, "column": 34, "offset": 748 } } } ], "position": { "start": { "line": 17, "column": 1, "offset": 585 }, "end": { "line": 19, "column": 34, "offset": 748 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local part = object:FindFirstAncestorWhichIsA(\"BasePart\")\n" } ], "position": { "start": { "line": 21, "column": 1, "offset": 750 }, "end": { "line": 23, "column": 4, "offset": 815 } } } ], "position": { "start": { "line": 21, "column": 1, "offset": 750 }, "end": { "line": 23, "column": 4, "offset": 815 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also, ", "position": { "start": { "line": 25, "column": 1, "offset": 817 }, "end": { "line": 25, "column": 11, "offset": 827 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstAncestor()" } ], "position": { "start": { "line": 25, "column": 11, "offset": 827 }, "end": { "line": 25, "column": 47, "offset": 863 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 25, "column": 47, "offset": 863 }, "end": { "line": 25, "column": 48, "offset": 864 } } } ], "position": { "start": { "line": 25, "column": 1, "offset": 817 }, "end": { "line": 25, "column": 48, "offset": 864 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "className", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ClassName" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 31, "offset": 30 } } }, { "type": "text", "value": " to be looked for.", "position": { "start": { "line": 1, "column": 31, "offset": 30 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "Instance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " found.", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:FindFirstChild", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first child of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 32, "offset": 31 }, "end": { "line": 1, "column": 48, "offset": 47 } } }, { "type": "text", "value": " found with the given name.", "position": { "start": { "line": 1, "column": 48, "offset": 47 }, "end": { "line": 1, "column": 75, "offset": 74 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 75, "offset": 74 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first child of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 32, "offset": 31 }, "end": { "line": 1, "column": 48, "offset": 47 } } }, { "type": "text", "value": " with the given name,", "position": { "start": { "line": 1, "column": 48, "offset": 47 }, "end": { "line": 1, "column": 69, "offset": 68 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 69, "offset": 68 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "or ", "position": { "start": { "line": 3, "column": 1, "offset": 70 }, "end": { "line": 3, "column": 4, "offset": 73 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "nil" } ], "position": { "start": { "line": 3, "column": 4, "offset": 73 }, "end": { "line": 3, "column": 9, "offset": 78 } } }, { "type": "text", "value": " if no such child exists. If the optional ", "position": { "start": { "line": 3, "column": 9, "offset": 78 }, "end": { "line": 3, "column": 51, "offset": 120 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "recursive" } ], "position": { "start": { "line": 3, "column": 51, "offset": 120 }, "end": { "line": 3, "column": 62, "offset": 131 } } }, { "type": "text", "value": " argument is\ntrue, this function searches all descendants rather than only the\nimmediate children of the ", "position": { "start": { "line": 3, "column": 62, "offset": 131 }, "end": { "line": 5, "column": 27, "offset": 236 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 5, "column": 27, "offset": 236 }, "end": { "line": 5, "column": 43, "offset": 252 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 5, "column": 43, "offset": 252 }, "end": { "line": 5, "column": 44, "offset": 253 } } } ], "position": { "start": { "line": 3, "column": 1, "offset": 70 }, "end": { "line": 5, "column": 44, "offset": 253 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Checking the Existence of an Object", "position": { "start": { "line": 7, "column": 6, "offset": 260 }, "end": { "line": 7, "column": 41, "offset": 295 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 255 }, "end": { "line": 7, "column": 41, "offset": 295 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "FindFirstChild is necessary if you need to verify an object exists before\ncontinuing. Attempting to index a child by name using the dot operator\nthrows an error if the child doesn't exist.", "position": { "start": { "line": 9, "column": 1, "offset": 297 }, "end": { "line": 11, "column": 44, "offset": 485 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 297 }, "end": { "line": 11, "column": 44, "offset": 485 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "-- The following line errors if Part doesn't exist in the Workspace:\nworkspace.Part.Transparency = 0.5\n" } ], "position": { "start": { "line": 13, "column": 1, "offset": 487 }, "end": { "line": 16, "column": 4, "offset": 600 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 487 }, "end": { "line": 16, "column": 4, "offset": 600 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Use FindFirstChild to first check for Part, then use an if-statement to\nrun code that needs it.", "position": { "start": { "line": 18, "column": 1, "offset": 602 }, "end": { "line": 19, "column": 24, "offset": 697 } } } ], "position": { "start": { "line": 18, "column": 1, "offset": 602 }, "end": { "line": 19, "column": 24, "offset": 697 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local part = workspace:FindFirstChild(\"Part\")\nif part then\n\tpart.Transparency = 0.5\nend\n" } ], "position": { "start": { "line": 21, "column": 1, "offset": 699 }, "end": { "line": 26, "column": 4, "offset": 797 } } } ], "position": { "start": { "line": 21, "column": 1, "offset": 699 }, "end": { "line": 26, "column": 4, "offset": 797 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Finding a Child Whose Name Matches a Property", "position": { "start": { "line": 28, "column": 6, "offset": 804 }, "end": { "line": 28, "column": 51, "offset": 849 } } } ], "position": { "start": { "line": 28, "column": 1, "offset": 799 }, "end": { "line": 28, "column": 51, "offset": 849 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Sometimes the ", "position": { "start": { "line": 30, "column": 1, "offset": 851 }, "end": { "line": 30, "column": 15, "offset": 865 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name|Name" } ], "position": { "start": { "line": 30, "column": 15, "offset": 865 }, "end": { "line": 30, "column": 41, "offset": 891 } } }, { "type": "text", "value": " of an object is the same as that\nof a property of its ", "position": { "start": { "line": 30, "column": 41, "offset": 891 }, "end": { "line": 31, "column": 22, "offset": 946 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent|Parent" } ], "position": { "start": { "line": 31, "column": 22, "offset": 946 }, "end": { "line": 31, "column": 52, "offset": 976 } } }, { "type": "text", "value": ". When using the dot\noperator, properties take precedence over children if they share a name.", "position": { "start": { "line": 31, "column": 52, "offset": 976 }, "end": { "line": 32, "column": 73, "offset": 1069 } } } ], "position": { "start": { "line": 30, "column": 1, "offset": 851 }, "end": { "line": 32, "column": 73, "offset": 1069 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "In the following example, a ", "position": { "start": { "line": 34, "column": 1, "offset": 1071 }, "end": { "line": 34, "column": 29, "offset": 1099 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Folder" } ], "position": { "start": { "line": 34, "column": 29, "offset": 1099 }, "end": { "line": 34, "column": 43, "offset": 1113 } } }, { "type": "text", "value": " called \"Color\" is added to a\n", "position": { "start": { "line": 34, "column": 43, "offset": 1113 }, "end": { "line": 35, "column": 1, "offset": 1143 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Part" } ], "position": { "start": { "line": 35, "column": 1, "offset": 1143 }, "end": { "line": 35, "column": 13, "offset": 1155 } } }, { "type": "text", "value": ", which also has the ", "position": { "start": { "line": 35, "column": 13, "offset": 1155 }, "end": { "line": 35, "column": 34, "offset": 1176 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Part.Color" } ], "position": { "start": { "line": 35, "column": 34, "offset": 1176 }, "end": { "line": 35, "column": 52, "offset": 1194 } } }, { "type": "text", "value": " property.\n", "position": { "start": { "line": 35, "column": 52, "offset": 1194 }, "end": { "line": 36, "column": 1, "offset": 1205 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Part.Color" } ], "position": { "start": { "line": 36, "column": 1, "offset": 1205 }, "end": { "line": 36, "column": 19, "offset": 1223 } } }, { "type": "text", "value": " refers to the ", "position": { "start": { "line": 36, "column": 19, "offset": 1223 }, "end": { "line": 36, "column": 34, "offset": 1238 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Datatype.Color3" } ], "position": { "start": { "line": 36, "column": 34, "offset": 1238 }, "end": { "line": 36, "column": 51, "offset": 1255 } } }, { "type": "text", "value": ", not the Folder.", "position": { "start": { "line": 36, "column": 51, "offset": 1255 }, "end": { "line": 36, "column": 68, "offset": 1272 } } } ], "position": { "start": { "line": 34, "column": 1, "offset": 1071 }, "end": { "line": 36, "column": 68, "offset": 1272 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local part = Instance.new(\"Part\")\nlocal folder = Instance.new(\"Folder\")\nfolder.Name = \"Color\"\nfolder.Parent = part\nlocal c = part.Color --> A Color3\nlocal c2 = part:FindFirstChild(\"Color\") --> The Folder\n" } ], "position": { "start": { "line": 38, "column": 1, "offset": 1274 }, "end": { "line": 45, "column": 4, "offset": 1488 } } } ], "position": { "start": { "line": 38, "column": 1, "offset": 1274 }, "end": { "line": 45, "column": 4, "offset": 1488 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A benefit of using ", "position": { "start": { "line": 47, "column": 1, "offset": 1490 }, "end": { "line": 47, "column": 20, "offset": 1509 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstChild()|FindFirstChild()" } ], "position": { "start": { "line": 47, "column": 20, "offset": 1509 }, "end": { "line": 47, "column": 70, "offset": 1559 } } }, { "type": "text", "value": " in\nthis way is that the introduction of new properties does not impose a risk\non your code.", "position": { "start": { "line": 47, "column": 70, "offset": 1559 }, "end": { "line": 49, "column": 14, "offset": 1651 } } } ], "position": { "start": { "line": 47, "column": 1, "offset": 1490 }, "end": { "line": 49, "column": 14, "offset": 1651 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Performance Note", "position": { "start": { "line": 51, "column": 6, "offset": 1658 }, "end": { "line": 51, "column": 22, "offset": 1674 } } } ], "position": { "start": { "line": 51, "column": 1, "offset": 1653 }, "end": { "line": 51, "column": 22, "offset": 1674 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstChild()|FindFirstChild()" } ], "position": { "start": { "line": 53, "column": 1, "offset": 1676 }, "end": { "line": 53, "column": 51, "offset": 1726 } } }, { "type": "text", "value": " takes about 20% longer\nthan using the dot operator and almost 8 times longer than simply storing\na reference to an object. Therefore, you should avoid calling it in\nperformance-dependent code such as in tight loops or functions connected\nto ", "position": { "start": { "line": 53, "column": 51, "offset": 1726 }, "end": { "line": 57, "column": 4, "offset": 1968 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.RunService.Heartbeat" } ], "position": { "start": { "line": 57, "column": 4, "offset": 1968 }, "end": { "line": 57, "column": 32, "offset": 1996 } } }, { "type": "text", "value": " and ", "position": { "start": { "line": 57, "column": 32, "offset": 1996 }, "end": { "line": 57, "column": 37, "offset": 2001 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.RunService.RenderStepped" } ], "position": { "start": { "line": 57, "column": 37, "offset": 2001 }, "end": { "line": 57, "column": 69, "offset": 2033 } } }, { "type": "text", "value": ".\nInstead, store the result in a variable, or consider using\n", "position": { "start": { "line": 57, "column": 69, "offset": 2033 }, "end": { "line": 59, "column": 1, "offset": 2094 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ChildAdded|ChildAdded" } ], "position": { "start": { "line": 59, "column": 1, "offset": 2094 }, "end": { "line": 59, "column": 39, "offset": 2132 } } }, { "type": "text", "value": " or\n", "position": { "start": { "line": 59, "column": 39, "offset": 2132 }, "end": { "line": 60, "column": 1, "offset": 2136 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:WaitForChild()|WaitForChild()" } ], "position": { "start": { "line": 60, "column": 1, "offset": 2136 }, "end": { "line": 60, "column": 47, "offset": 2182 } } }, { "type": "text", "value": " to detect when a child of a\ngiven name becomes available.", "position": { "start": { "line": 60, "column": 47, "offset": 2182 }, "end": { "line": 61, "column": 30, "offset": 2240 } } } ], "position": { "start": { "line": 53, "column": 1, "offset": 1676 }, "end": { "line": 61, "column": 30, "offset": 2240 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-FindFirstChild1", "displayName": "Instance:FindFirstChild", "description": "The below would look in Workspace for an object name \"Brick\". If found, it\nwill change the name of the object to \"Foo\".\n", "codeSample": "local found = workspace:FindFirstChild(\"Brick\")\n\nif found then\n\tfound.Name = \"Foo\"\nend", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "name", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 26, "offset": 25 } } }, { "type": "text", "value": " to be searched for.", "position": { "start": { "line": 1, "column": 26, "offset": 25 }, "end": { "line": 1, "column": 46, "offset": 45 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 46, "offset": 45 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } }, { "name": "recursive", "type": "bool", "default": "false", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Whether or not the search should be conducted recursively.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "Instance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " found.", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:FindFirstChildOfClass", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first child of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 32, "offset": 31 }, "end": { "line": 1, "column": 48, "offset": 47 } } }, { "type": "text", "value": " whose\n", "position": { "start": { "line": 1, "column": 48, "offset": 47 }, "end": { "line": 2, "column": 1, "offset": 54 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ClassName|ClassName" } ], "position": { "start": { "line": 2, "column": 1, "offset": 54 }, "end": { "line": 2, "column": 37, "offset": 90 } } }, { "type": "text", "value": " is equal to the given className.", "position": { "start": { "line": 2, "column": 37, "offset": 90 }, "end": { "line": 2, "column": 70, "offset": 123 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 70, "offset": 123 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first child of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 32, "offset": 31 }, "end": { "line": 1, "column": 48, "offset": 47 } } }, { "type": "text", "value": " whose\n", "position": { "start": { "line": 1, "column": 48, "offset": 47 }, "end": { "line": 2, "column": 1, "offset": 54 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ClassName|ClassName" } ], "position": { "start": { "line": 2, "column": 1, "offset": 54 }, "end": { "line": 2, "column": 37, "offset": 90 } } }, { "type": "text", "value": " is equal to the given className.", "position": { "start": { "line": 2, "column": 37, "offset": 90 }, "end": { "line": 2, "column": 70, "offset": 123 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 70, "offset": 123 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If no matching child is found, this function returns nil.", "position": { "start": { "line": 4, "column": 1, "offset": 125 }, "end": { "line": 4, "column": 58, "offset": 182 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 125 }, "end": { "line": 4, "column": 58, "offset": 182 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Unlike ", "position": { "start": { "line": 6, "column": 1, "offset": 184 }, "end": { "line": 6, "column": 8, "offset": 191 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstChildWhichIsA()" } ], "position": { "start": { "line": 6, "column": 8, "offset": 191 }, "end": { "line": 6, "column": 49, "offset": 232 } } }, { "type": "text", "value": " this function uses only\nreturns objects whose class matches the given className, ignoring class\ninheritance.", "position": { "start": { "line": 6, "column": 49, "offset": 232 }, "end": { "line": 8, "column": 13, "offset": 341 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 184 }, "end": { "line": 8, "column": 13, "offset": 341 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Developers looking for a child by name should use\n", "position": { "start": { "line": 10, "column": 1, "offset": 343 }, "end": { "line": 11, "column": 1, "offset": 393 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstChild()" } ], "position": { "start": { "line": 11, "column": 1, "offset": 393 }, "end": { "line": 11, "column": 34, "offset": 426 } } }, { "type": "text", "value": " instead.", "position": { "start": { "line": 11, "column": 34, "offset": 426 }, "end": { "line": 11, "column": 43, "offset": 435 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 343 }, "end": { "line": 11, "column": 43, "offset": 435 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-FindFirstChildOfClass1", "displayName": "Instance:FindFirstChildOfClass", "description": "", "codeSample": "local Players = game:GetService(\"Players\")\n\nlocal player = Players.LocalPlayer\nlocal character = player.Character or player.CharacterAdded:Wait()\n\nlocal humanoid\n\nwhile not humanoid do\n\thumanoid = character:FindFirstChildOfClass(\"Humanoid\")\n\tif not humanoid then\n\t\tcharacter.ChildAdded:Wait()\n\tend\nend", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "className", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ClassName" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 31, "offset": 30 } } }, { "type": "text", "value": " to be looked for.", "position": { "start": { "line": 1, "column": 31, "offset": 30 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "Instance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " found.", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:FindFirstChildWhichIsA", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first child of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 32, "offset": 31 }, "end": { "line": 1, "column": 48, "offset": 47 } } }, { "type": "text", "value": " for whom\n", "position": { "start": { "line": 1, "column": 48, "offset": 47 }, "end": { "line": 2, "column": 1, "offset": 57 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsA()" } ], "position": { "start": { "line": 2, "column": 1, "offset": 57 }, "end": { "line": 2, "column": 23, "offset": 79 } } }, { "type": "text", "value": " returns true for the given className.", "position": { "start": { "line": 2, "column": 23, "offset": 79 }, "end": { "line": 2, "column": 61, "offset": 117 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 61, "offset": 117 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first child of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 32, "offset": 31 }, "end": { "line": 1, "column": 48, "offset": 47 } } }, { "type": "text", "value": " for whom\n", "position": { "start": { "line": 1, "column": 48, "offset": 47 }, "end": { "line": 2, "column": 1, "offset": 57 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsA()" } ], "position": { "start": { "line": 2, "column": 1, "offset": 57 }, "end": { "line": 2, "column": 23, "offset": 79 } } }, { "type": "text", "value": " returns true for the given className.", "position": { "start": { "line": 2, "column": 23, "offset": 79 }, "end": { "line": 2, "column": 61, "offset": 117 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 61, "offset": 117 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If no matching child is found, this function returns nil. If the optional\nrecursive argument is true, this function searches all descendants rather\nthan only the immediate children of the ", "position": { "start": { "line": 4, "column": 1, "offset": 119 }, "end": { "line": 6, "column": 41, "offset": 307 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 6, "column": 41, "offset": 307 }, "end": { "line": 6, "column": 57, "offset": 323 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 6, "column": 57, "offset": 323 }, "end": { "line": 6, "column": 58, "offset": 324 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 119 }, "end": { "line": 6, "column": 58, "offset": 324 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Unlike ", "position": { "start": { "line": 8, "column": 1, "offset": 326 }, "end": { "line": 8, "column": 8, "offset": 333 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstChildOfClass()" } ], "position": { "start": { "line": 8, "column": 8, "offset": 333 }, "end": { "line": 8, "column": 48, "offset": 373 } } }, { "type": "text", "value": ", this function uses\n", "position": { "start": { "line": 8, "column": 48, "offset": 373 }, "end": { "line": 9, "column": 1, "offset": 394 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsA()" } ], "position": { "start": { "line": 9, "column": 1, "offset": 394 }, "end": { "line": 9, "column": 23, "offset": 416 } } }, { "type": "text", "value": " which respects class inheritance. For example:", "position": { "start": { "line": 9, "column": 23, "offset": 416 }, "end": { "line": 9, "column": 70, "offset": 463 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 326 }, "end": { "line": 9, "column": 70, "offset": 463 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "print(part:IsA(\"Part\")) --> true\nprint(part:IsA(\"BasePart\")) --> true\nprint(part:IsA(\"Instance\")) --> true\n" } ], "position": { "start": { "line": 11, "column": 1, "offset": 465 }, "end": { "line": 15, "column": 4, "offset": 582 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 465 }, "end": { "line": 15, "column": 4, "offset": 582 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Therefore, the following code sample will return the first\n", "position": { "start": { "line": 17, "column": 1, "offset": 584 }, "end": { "line": 18, "column": 1, "offset": 643 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.BasePart" } ], "position": { "start": { "line": 18, "column": 1, "offset": 643 }, "end": { "line": 18, "column": 17, "offset": 659 } } }, { "type": "text", "value": " child, regardless of if it is a ", "position": { "start": { "line": 18, "column": 17, "offset": 659 }, "end": { "line": 18, "column": 50, "offset": 692 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.WedgePart" } ], "position": { "start": { "line": 18, "column": 50, "offset": 692 }, "end": { "line": 18, "column": 67, "offset": 709 } } }, { "type": "text", "value": ",\n", "position": { "start": { "line": 18, "column": 67, "offset": 709 }, "end": { "line": 19, "column": 1, "offset": 711 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.MeshPart" } ], "position": { "start": { "line": 19, "column": 1, "offset": 711 }, "end": { "line": 19, "column": 17, "offset": 727 } } }, { "type": "text", "value": " or ", "position": { "start": { "line": 19, "column": 17, "offset": 727 }, "end": { "line": 19, "column": 21, "offset": 731 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Part" } ], "position": { "start": { "line": 19, "column": 21, "offset": 731 }, "end": { "line": 19, "column": 33, "offset": 743 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 19, "column": 33, "offset": 743 }, "end": { "line": 19, "column": 34, "offset": 744 } } } ], "position": { "start": { "line": 17, "column": 1, "offset": 584 }, "end": { "line": 19, "column": 34, "offset": 744 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local part = object:FindFirstChildWhichIsA(\"BasePart\")\n" } ], "position": { "start": { "line": 21, "column": 1, "offset": 746 }, "end": { "line": 23, "column": 4, "offset": 808 } } } ], "position": { "start": { "line": 21, "column": 1, "offset": 746 }, "end": { "line": 23, "column": 4, "offset": 808 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Developers looking for a child by name, should use\n", "position": { "start": { "line": 25, "column": 1, "offset": 810 }, "end": { "line": 26, "column": 1, "offset": 861 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstChild()" } ], "position": { "start": { "line": 26, "column": 1, "offset": 861 }, "end": { "line": 26, "column": 34, "offset": 894 } } }, { "type": "text", "value": " instead.", "position": { "start": { "line": 26, "column": 34, "offset": 894 }, "end": { "line": 26, "column": 43, "offset": 903 } } } ], "position": { "start": { "line": 25, "column": 1, "offset": 810 }, "end": { "line": 26, "column": 43, "offset": 903 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "className", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ClassName" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 31, "offset": 30 } } }, { "type": "text", "value": " to be searched for.", "position": { "start": { "line": 1, "column": 31, "offset": 30 }, "end": { "line": 1, "column": 51, "offset": 50 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 51, "offset": 50 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } }, { "name": "recursive", "type": "bool", "default": "false", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Whether or not the search should be conducted recursively.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "Instance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " found.", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:FindFirstDescendant", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first descendant found with the given ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 51, "offset": 50 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name" } ], "position": { "start": { "line": 1, "column": 51, "offset": 50 }, "end": { "line": 1, "column": 72, "offset": 71 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 72, "offset": 71 }, "end": { "line": 1, "column": 73, "offset": 72 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 73, "offset": 72 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the first descendant found with the given ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 51, "offset": 50 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name" } ], "position": { "start": { "line": 1, "column": 51, "offset": 50 }, "end": { "line": 1, "column": 72, "offset": 71 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 72, "offset": 71 }, "end": { "line": 1, "column": 73, "offset": 72 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 73, "offset": 72 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "name", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 26, "offset": 25 } } }, { "type": "text", "value": " to search for.", "position": { "start": { "line": 1, "column": 26, "offset": 25 }, "end": { "line": 1, "column": 41, "offset": 40 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 41, "offset": 40 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "Instance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " found.", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:GetActor", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 13, "offset": 12 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Actor" } ], "position": { "start": { "line": 1, "column": 13, "offset": 12 }, "end": { "line": 1, "column": 26, "offset": 25 } } }, { "type": "text", "value": " associated with the Instance, if any.", "position": { "start": { "line": 1, "column": 26, "offset": 25 }, "end": { "line": 1, "column": 64, "offset": 63 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 64, "offset": 63 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 8, "offset": 7 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 8, "offset": 7 }, "end": { "line": 1, "column": 24, "offset": 23 } } }, { "type": "text", "value": " is an ", "position": { "start": { "line": 1, "column": 24, "offset": 23 }, "end": { "line": 1, "column": 31, "offset": 30 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Actor" } ], "position": { "start": { "line": 1, "column": 31, "offset": 30 }, "end": { "line": 1, "column": 44, "offset": 43 } } }, { "type": "text", "value": ", the ", "position": { "start": { "line": 1, "column": 44, "offset": 43 }, "end": { "line": 1, "column": 50, "offset": 49 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Actor" } ], "position": { "start": { "line": 1, "column": 50, "offset": 49 }, "end": { "line": 1, "column": 63, "offset": 62 } } }, { "type": "text", "value": " itself is\nreturned. Otherwise, its closest ancestor ", "position": { "start": { "line": 1, "column": 63, "offset": 62 }, "end": { "line": 2, "column": 43, "offset": 115 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Actor" } ], "position": { "start": { "line": 2, "column": 43, "offset": 115 }, "end": { "line": 2, "column": 56, "offset": 128 } } }, { "type": "text", "value": " is returned. If no\nancestor is an ", "position": { "start": { "line": 2, "column": 56, "offset": 128 }, "end": { "line": 3, "column": 16, "offset": 163 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Actor" } ], "position": { "start": { "line": 3, "column": 16, "offset": 163 }, "end": { "line": 3, "column": 29, "offset": 176 } } }, { "type": "text", "value": ", the result is ", "position": { "start": { "line": 3, "column": 29, "offset": 176 }, "end": { "line": 3, "column": 45, "offset": 192 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "nil" } ], "position": { "start": { "line": 3, "column": 45, "offset": 192 }, "end": { "line": 3, "column": 50, "offset": 197 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 3, "column": 50, "offset": 197 }, "end": { "line": 3, "column": 51, "offset": 198 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 51, "offset": 198 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [], "returns": [ { "type": "Actor", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Actor" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 18, "offset": 17 } } }, { "type": "text", "value": " found.", "position": { "start": { "line": 1, "column": 18, "offset": 17 }, "end": { "line": 1, "column": 25, "offset": 24 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 25, "offset": 24 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:GetAttribute", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the attribute which has been assigned to the given name.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 65, "offset": 64 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 65, "offset": 64 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function returns the attribute which has been assigned to the given\nname. If no attribute has been assigned then nil is returned.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 62, "offset": 134 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 62, "offset": 134 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "For example, the following code snippet will set the value of the\ninstance's ", "position": { "start": { "line": 4, "column": 1, "offset": 136 }, "end": { "line": 5, "column": 12, "offset": 213 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "InitialPostion" } ], "position": { "start": { "line": 5, "column": 12, "offset": 213 }, "end": { "line": 5, "column": 28, "offset": 229 } } }, { "type": "text", "value": " attribute. Note that this code sample does not\ndefine ", "position": { "start": { "line": 5, "column": 28, "offset": 229 }, "end": { "line": 6, "column": 8, "offset": 284 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 6, "column": 8, "offset": 284 }, "end": { "line": 6, "column": 24, "offset": 300 } } }, { "type": "text", "value": ":", "position": { "start": { "line": 6, "column": 24, "offset": 300 }, "end": { "line": 6, "column": 25, "offset": 301 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 136 }, "end": { "line": 6, "column": 25, "offset": 301 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local initialPosition = instance:GetAttribute(\"InitialPosition\")\n" } ], "position": { "start": { "line": 8, "column": 1, "offset": 303 }, "end": { "line": 10, "column": 4, "offset": 378 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 303 }, "end": { "line": 10, "column": 4, "offset": 378 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also:", "position": { "start": { "line": 12, "column": 1, "offset": 380 }, "end": { "line": 12, "column": 10, "offset": 389 } } } ], "position": { "start": { "line": 12, "column": 1, "offset": 380 }, "end": { "line": 12, "column": 10, "offset": 389 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:SetAttribute()" } ], "position": { "start": { "line": 14, "column": 3, "offset": 393 }, "end": { "line": 14, "column": 34, "offset": 424 } } }, { "type": "text", "value": ", sets the attribute with the given name\nto the given value", "position": { "start": { "line": 14, "column": 34, "offset": 424 }, "end": { "line": 15, "column": 21, "offset": 485 } } } ], "position": { "start": { "line": 14, "column": 1, "offset": 391 }, "end": { "line": 15, "column": 21, "offset": 485 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetAttributes()" } ], "position": { "start": { "line": 16, "column": 3, "offset": 488 }, "end": { "line": 16, "column": 35, "offset": 520 } } }, { "type": "text", "value": ", returns a dictionary of string →\nvariant pairs for each of the instance's attributes", "position": { "start": { "line": 16, "column": 35, "offset": 520 }, "end": { "line": 17, "column": 54, "offset": 608 } } } ], "position": { "start": { "line": 16, "column": 1, "offset": 486 }, "end": { "line": 17, "column": 54, "offset": 608 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.AttributeChanged" } ], "position": { "start": { "line": 18, "column": 3, "offset": 611 }, "end": { "line": 18, "column": 36, "offset": 644 } } }, { "type": "text", "value": ", fires whenever an attribute is\nchanged on the instance", "position": { "start": { "line": 18, "column": 36, "offset": 644 }, "end": { "line": 19, "column": 26, "offset": 702 } } } ], "position": { "start": { "line": 18, "column": 1, "offset": 609 }, "end": { "line": 19, "column": 26, "offset": 702 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetAttributeChangedSignal()" } ], "position": { "start": { "line": 20, "column": 3, "offset": 705 }, "end": { "line": 20, "column": 47, "offset": 749 } } }, { "type": "text", "value": ", returns an event that\nfires when the given attribute changes", "position": { "start": { "line": 20, "column": 47, "offset": 749 }, "end": { "line": 21, "column": 41, "offset": 813 } } } ], "position": { "start": { "line": 20, "column": 1, "offset": 703 }, "end": { "line": 21, "column": 41, "offset": 813 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 14, "column": 1, "offset": 391 }, "end": { "line": 21, "column": 41, "offset": 813 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "attribute", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The name of the attribute being retrieved.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 43, "offset": 42 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 43, "offset": 42 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "Variant", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The attribute which has been assigned to the given name. If no\nattribute has been assigned then nil is returned.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 50, "offset": 112 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 50, "offset": 112 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:GetAttributeChangedSignal", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns an event that fires when the given attribute changes.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 62, "offset": 61 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 62, "offset": 61 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function returns an event that behaves exactly like the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 62, "offset": 61 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Changed" } ], "position": { "start": { "line": 1, "column": 62, "offset": 61 }, "end": { "line": 1, "column": 71, "offset": 70 } } }, { "type": "text", "value": "\nevent, except that the event only fires when the given attribute changes.\nIt's generally a good idea to use this method instead of a connection to\nChanged with a function that checks the attribute name. Subsequent calls\nto this method on the same object with the same attribute name return the\nsame event.", "position": { "start": { "line": 1, "column": 71, "offset": 70 }, "end": { "line": 6, "column": 12, "offset": 376 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 6, "column": 12, "offset": 376 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "It is similar to ", "position": { "start": { "line": 8, "column": 1, "offset": 378 }, "end": { "line": 8, "column": 18, "offset": 395 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetPropertyChangedSignal()" } ], "position": { "start": { "line": 8, "column": 18, "offset": 395 }, "end": { "line": 8, "column": 61, "offset": 438 } } }, { "type": "text", "value": " but for\nattributes.", "position": { "start": { "line": 8, "column": 61, "offset": 438 }, "end": { "line": 9, "column": 12, "offset": 458 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 378 }, "end": { "line": 9, "column": 12, "offset": 458 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "For example, the following code snippet will return a signal that fires\nthe function ", "position": { "start": { "line": 11, "column": 1, "offset": 460 }, "end": { "line": 12, "column": 14, "offset": 545 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.AttributeChanged" } ], "position": { "start": { "line": 12, "column": 14, "offset": 545 }, "end": { "line": 12, "column": 47, "offset": 578 } } }, { "type": "text", "value": " when the instance's\n", "position": { "start": { "line": 12, "column": 47, "offset": 578 }, "end": { "line": 13, "column": 1, "offset": 599 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "InitialPosition" } ], "position": { "start": { "line": 13, "column": 1, "offset": 599 }, "end": { "line": 13, "column": 18, "offset": 616 } } }, { "type": "text", "value": " attribute changes. Note that this code sample does not\ndefine ", "position": { "start": { "line": 13, "column": 18, "offset": 616 }, "end": { "line": 14, "column": 8, "offset": 679 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 14, "column": 8, "offset": 679 }, "end": { "line": 14, "column": 24, "offset": 695 } } }, { "type": "text", "value": ":", "position": { "start": { "line": 14, "column": 24, "offset": 695 }, "end": { "line": 14, "column": 25, "offset": 696 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 460 }, "end": { "line": 14, "column": 25, "offset": 696 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local function attributeChanged()\n print(\"Attribute changed\")\nend\n\ninstance:GetAttributeChangedSignal(\"InitialPosition\"):Connect(attributeChanged)\n" } ], "position": { "start": { "line": 16, "column": 1, "offset": 698 }, "end": { "line": 22, "column": 4, "offset": 858 } } } ], "position": { "start": { "line": 16, "column": 1, "offset": 698 }, "end": { "line": 22, "column": 4, "offset": 858 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also:", "position": { "start": { "line": 24, "column": 1, "offset": 860 }, "end": { "line": 24, "column": 10, "offset": 869 } } } ], "position": { "start": { "line": 24, "column": 1, "offset": 860 }, "end": { "line": 24, "column": 10, "offset": 869 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:SetAttribute()" } ], "position": { "start": { "line": 26, "column": 3, "offset": 873 }, "end": { "line": 26, "column": 34, "offset": 904 } } }, { "type": "text", "value": ", sets the attribute with the given name\nto the given value", "position": { "start": { "line": 26, "column": 34, "offset": 904 }, "end": { "line": 27, "column": 21, "offset": 965 } } } ], "position": { "start": { "line": 26, "column": 1, "offset": 871 }, "end": { "line": 27, "column": 21, "offset": 965 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetAttribute()" } ], "position": { "start": { "line": 28, "column": 3, "offset": 968 }, "end": { "line": 28, "column": 34, "offset": 999 } } }, { "type": "text", "value": ", returns the attribute which has been\nassigned to the given name", "position": { "start": { "line": 28, "column": 34, "offset": 999 }, "end": { "line": 29, "column": 29, "offset": 1066 } } } ], "position": { "start": { "line": 28, "column": 1, "offset": 966 }, "end": { "line": 29, "column": 29, "offset": 1066 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetAttributes()" } ], "position": { "start": { "line": 30, "column": 3, "offset": 1069 }, "end": { "line": 30, "column": 35, "offset": 1101 } } }, { "type": "text", "value": ", returns a dictionary of string →\nvariant pairs for each of the instance's attributes", "position": { "start": { "line": 30, "column": 35, "offset": 1101 }, "end": { "line": 31, "column": 54, "offset": 1189 } } } ], "position": { "start": { "line": 30, "column": 1, "offset": 1067 }, "end": { "line": 31, "column": 54, "offset": 1189 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.AttributeChanged" } ], "position": { "start": { "line": 32, "column": 3, "offset": 1192 }, "end": { "line": 32, "column": 36, "offset": 1225 } } }, { "type": "text", "value": ", fires whenever an attribute is\nchanged on the instance", "position": { "start": { "line": 32, "column": 36, "offset": 1225 }, "end": { "line": 33, "column": 26, "offset": 1283 } } } ], "position": { "start": { "line": 32, "column": 1, "offset": 1190 }, "end": { "line": 33, "column": 26, "offset": 1283 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 26, "column": 1, "offset": 871 }, "end": { "line": 33, "column": 26, "offset": 1283 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "attribute", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The name of the specified attribute for which the change signal is\nbeing returned.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 16, "offset": 82 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 16, "offset": 82 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "RBXScriptSignal", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "An event that fires when the given attribute changes.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 54, "offset": 53 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 54, "offset": 53 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:GetAttributes", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns a dictionary of string → variant pairs for each of the\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 63 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 2, "column": 1, "offset": 63 }, "end": { "line": 2, "column": 17, "offset": 79 } } }, { "type": "text", "value": "'s attributes.", "position": { "start": { "line": 2, "column": 17, "offset": 79 }, "end": { "line": 2, "column": 31, "offset": 93 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 31, "offset": 93 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function returns a dictionary of string → variant pairs for each\nattribute where the string is the name of the attribute and the variant is\na non-nil value.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 17, "offset": 161 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 17, "offset": 161 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "For example, the following code snippet will print an instance's\nattributes and values. Note that this code sample does not define\n", "position": { "start": { "line": 5, "column": 1, "offset": 163 }, "end": { "line": 7, "column": 1, "offset": 294 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 7, "column": 1, "offset": 294 }, "end": { "line": 7, "column": 17, "offset": 310 } } }, { "type": "text", "value": ":", "position": { "start": { "line": 7, "column": 17, "offset": 310 }, "end": { "line": 7, "column": 18, "offset": 311 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 163 }, "end": { "line": 7, "column": 18, "offset": 311 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local attributes = instance:GetAttributes()\nfor name, value in pairs(attributes) do\n print(name .. \" \" .. value)\nend\n" } ], "position": { "start": { "line": 9, "column": 1, "offset": 313 }, "end": { "line": 14, "column": 4, "offset": 443 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 313 }, "end": { "line": 14, "column": 4, "offset": 443 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also:", "position": { "start": { "line": 16, "column": 1, "offset": 445 }, "end": { "line": 16, "column": 10, "offset": 454 } } } ], "position": { "start": { "line": 16, "column": 1, "offset": 445 }, "end": { "line": 16, "column": 10, "offset": 454 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:SetAttribute()" } ], "position": { "start": { "line": 18, "column": 3, "offset": 458 }, "end": { "line": 18, "column": 34, "offset": 489 } } }, { "type": "text", "value": ", sets the attribute with the given name\nto the given value", "position": { "start": { "line": 18, "column": 34, "offset": 489 }, "end": { "line": 19, "column": 21, "offset": 550 } } } ], "position": { "start": { "line": 18, "column": 1, "offset": 456 }, "end": { "line": 19, "column": 21, "offset": 550 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetAttribute()" } ], "position": { "start": { "line": 20, "column": 3, "offset": 553 }, "end": { "line": 20, "column": 34, "offset": 584 } } }, { "type": "text", "value": ", returns the attribute which has been\nassigned to the given name", "position": { "start": { "line": 20, "column": 34, "offset": 584 }, "end": { "line": 21, "column": 29, "offset": 651 } } } ], "position": { "start": { "line": 20, "column": 1, "offset": 551 }, "end": { "line": 21, "column": 29, "offset": 651 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.AttributeChanged" } ], "position": { "start": { "line": 22, "column": 3, "offset": 654 }, "end": { "line": 22, "column": 36, "offset": 687 } } }, { "type": "text", "value": ", fires whenever an attribute is\nchanged on the instance", "position": { "start": { "line": 22, "column": 36, "offset": 687 }, "end": { "line": 23, "column": 26, "offset": 745 } } } ], "position": { "start": { "line": 22, "column": 1, "offset": 652 }, "end": { "line": 23, "column": 26, "offset": 745 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetAttributeChangedSignal()" } ], "position": { "start": { "line": 24, "column": 3, "offset": 748 }, "end": { "line": 24, "column": 47, "offset": 792 } } }, { "type": "text", "value": ", returns an event that\nfires when the given attribute changes", "position": { "start": { "line": 24, "column": 47, "offset": 792 }, "end": { "line": 25, "column": 41, "offset": 856 } } } ], "position": { "start": { "line": 24, "column": 1, "offset": 746 }, "end": { "line": 25, "column": 41, "offset": 856 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 18, "column": 1, "offset": 456 }, "end": { "line": 25, "column": 41, "offset": 856 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [], "returns": [ { "type": "Dictionary", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A dictionary of string → variant pairs for each attribute where the\nstring is the name of the attribute and the variant is a non-nil\nvalue.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 7, "offset": 139 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 7, "offset": 139 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:GetChildren", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns an array containing all of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 40, "offset": 39 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 40, "offset": 39 }, "end": { "line": 1, "column": 56, "offset": 55 } } }, { "type": "text", "value": "'s children.", "position": { "start": { "line": 1, "column": 56, "offset": 55 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns an array (a numerically indexed table) containing all of the\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 69 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 2, "column": 1, "offset": 69 }, "end": { "line": 2, "column": 17, "offset": 85 } } }, { "type": "text", "value": "'s direct children, or every ", "position": { "start": { "line": 2, "column": 17, "offset": 85 }, "end": { "line": 2, "column": 46, "offset": 114 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 2, "column": 46, "offset": 114 }, "end": { "line": 2, "column": 62, "offset": 130 } } }, { "type": "text", "value": " whose\n", "position": { "start": { "line": 2, "column": 62, "offset": 130 }, "end": { "line": 3, "column": 1, "offset": 137 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent|Parent" } ], "position": { "start": { "line": 3, "column": 1, "offset": 137 }, "end": { "line": 3, "column": 31, "offset": 167 } } }, { "type": "text", "value": " is equal to the object. The array can be\niterated upon using either a numeric or generic for-loop:", "position": { "start": { "line": 3, "column": 31, "offset": 167 }, "end": { "line": 4, "column": 58, "offset": 266 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 58, "offset": 266 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "-- Numeric for-loop example\nlocal children = workspace:GetChildren()\nfor i = 1, #children do\n\tlocal child = children[i]\n\tprint(child.Name .. \" is child number \" .. i)\nend\n" } ], "position": { "start": { "line": 6, "column": 1, "offset": 268 }, "end": { "line": 13, "column": 4, "offset": 449 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 268 }, "end": { "line": 13, "column": 4, "offset": 449 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "-- Generic for-loop example\nlocal children = workspace:GetChildren()\nfor i, child in ipairs(children) do\n\tprint(child.Name .. \" is child number \" .. i)\nend\n" } ], "position": { "start": { "line": 15, "column": 1, "offset": 451 }, "end": { "line": 21, "column": 4, "offset": 617 } } } ], "position": { "start": { "line": 15, "column": 1, "offset": 451 }, "end": { "line": 21, "column": 4, "offset": 617 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The children are sorted by the order in which their\n", "position": { "start": { "line": 23, "column": 1, "offset": 619 }, "end": { "line": 24, "column": 1, "offset": 671 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent|Parent" } ], "position": { "start": { "line": 24, "column": 1, "offset": 671 }, "end": { "line": 24, "column": 31, "offset": 701 } } }, { "type": "text", "value": " property was set to the object.", "position": { "start": { "line": 24, "column": 31, "offset": 701 }, "end": { "line": 24, "column": 63, "offset": 733 } } } ], "position": { "start": { "line": 23, "column": 1, "offset": 619 }, "end": { "line": 24, "column": 63, "offset": 733 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also the ", "position": { "start": { "line": 26, "column": 1, "offset": 735 }, "end": { "line": 26, "column": 14, "offset": 748 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetDescendants()|GetDescendants" } ], "position": { "start": { "line": 26, "column": 14, "offset": 748 }, "end": { "line": 26, "column": 62, "offset": 796 } } }, { "type": "text", "value": " function.", "position": { "start": { "line": 26, "column": 62, "offset": 796 }, "end": { "line": 26, "column": 72, "offset": 806 } } } ], "position": { "start": { "line": 26, "column": 1, "offset": 735 }, "end": { "line": 26, "column": 72, "offset": 806 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-GetChildren1", "displayName": "Instance:GetChildren", "description": "The below would print the name of all objects currently in Workspace when ran.\n", "codeSample": "local children = workspace:GetChildren()\n\nfor i = 1, #children do\n\tprint(i, children[i].Name)\nend", "expectedOutput": "", "highlightLines": "" } ], "parameters": [], "returns": [ { "type": "Objects", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "An array containing the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 25, "offset": 24 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 25, "offset": 24 }, "end": { "line": 1, "column": 41, "offset": 40 } } }, { "type": "text", "value": "'s children.", "position": { "start": { "line": 1, "column": 41, "offset": 40 }, "end": { "line": 1, "column": 53, "offset": 52 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 53, "offset": 52 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:GetDebugId", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns a coded string of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 31, "offset": 30 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 31, "offset": 30 }, "end": { "line": 1, "column": 47, "offset": 46 } } }, { "type": "text", "value": "s DebugId used internally by\nRoblox.", "position": { "start": { "line": 1, "column": 47, "offset": 46 }, "end": { "line": 2, "column": 8, "offset": 82 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 8, "offset": 82 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns a coded string of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 31, "offset": 30 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 31, "offset": 30 }, "end": { "line": 1, "column": 47, "offset": 46 } } }, { "type": "text", "value": "s DebugId used internally by\nRoblox.", "position": { "start": { "line": 1, "column": 47, "offset": 46 }, "end": { "line": 2, "column": 8, "offset": 82 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 8, "offset": 82 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note:", "position": { "start": { "line": 4, "column": 1, "offset": 84 }, "end": { "line": 4, "column": 6, "offset": 89 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 84 }, "end": { "line": 4, "column": 6, "offset": 89 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "This item is protected. Attempting to use it in a ", "position": { "start": { "line": 6, "column": 3, "offset": 93 }, "end": { "line": 6, "column": 53, "offset": 143 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Script" } ], "position": { "start": { "line": 6, "column": 53, "offset": 143 }, "end": { "line": 6, "column": 67, "offset": 157 } } }, { "type": "text", "value": " or\n", "position": { "start": { "line": 6, "column": 67, "offset": 157 }, "end": { "line": 7, "column": 1, "offset": 161 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 7, "column": 3, "offset": 163 }, "end": { "line": 7, "column": 22, "offset": 182 } } }, { "type": "text", "value": " will cause an error", "position": { "start": { "line": 7, "column": 22, "offset": 182 }, "end": { "line": 7, "column": 42, "offset": 202 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 91 }, "end": { "line": 7, "column": 42, "offset": 202 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "A debug ID is an ID used in debugging processes. It allows a debugger to\nread each instruction before an application processes it. All objects in\nRoblox act like processes and each run instructions (or 'code') that can\nbe debugged if needed", "position": { "start": { "line": 8, "column": 3, "offset": 205 }, "end": { "line": 11, "column": 24, "offset": 451 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 203 }, "end": { "line": 11, "column": 24, "offset": 451 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "This can be helpful for plugins which need to distinguish similar\nobjects from one-another (such as objects that share the same name)", "position": { "start": { "line": 12, "column": 3, "offset": 454 }, "end": { "line": 13, "column": 70, "offset": 589 } } } ], "position": { "start": { "line": 12, "column": 1, "offset": 452 }, "end": { "line": 13, "column": 70, "offset": 589 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 6, "column": 1, "offset": 91 }, "end": { "line": 13, "column": 70, "offset": 589 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-GetDebugId1", "displayName": "Instance:GetDebugId", "description": "", "codeSample": "print(workspace:GetDebugId()) --> 39FA_12\nprint(workspace:GetDebugId(10)) --> 39FA2FEF4D_12\nprint(workspace:GetDebugId(math.huge)) --> 12", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "scopeLength", "type": "int", "default": "4", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The scope length.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 18, "offset": 17 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 18, "offset": 17 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "string", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The Debug ID string.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 21, "offset": 20 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 21, "offset": 20 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [ "NOT_BROWSABLE" ], "deprecationMessage": "", "security": [ "PLUGIN_SECURITY" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:GetDescendants", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns an array containing all of the descendants of the instance.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "GetDescendants", "position": { "start": { "line": 1, "column": 7, "offset": 6 }, "end": { "line": 1, "column": 21, "offset": 20 } } } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 23, "offset": 22 } } }, { "type": "text", "value": " function of an object returns an array that\ncontains all of the descendants of that object. Unlike\n", "position": { "start": { "line": 1, "column": 23, "offset": 22 }, "end": { "line": 3, "column": 1, "offset": 122 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetChildren()" } ], "position": { "start": { "line": 3, "column": 1, "offset": 122 }, "end": { "line": 3, "column": 31, "offset": 152 } } }, { "type": "text", "value": ", which only returns the immediate children\nof an object, GetDescendants will find every child of the object, every\nchild of those children, and so on.", "position": { "start": { "line": 3, "column": 31, "offset": 152 }, "end": { "line": 5, "column": 36, "offset": 303 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 5, "column": 36, "offset": 303 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The arrays returned by GetDescendants are arranged so that parents come\nearlier than their children. Refer to the following example of a\n", "position": { "start": { "line": 7, "column": 1, "offset": 305 }, "end": { "line": 9, "column": 1, "offset": 442 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Model" } ], "position": { "start": { "line": 9, "column": 1, "offset": 442 }, "end": { "line": 9, "column": 14, "offset": 455 } } }, { "type": "text", "value": " in the ", "position": { "start": { "line": 9, "column": 14, "offset": 455 }, "end": { "line": 9, "column": 22, "offset": 463 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Workspace" } ], "position": { "start": { "line": 9, "column": 22, "offset": 463 }, "end": { "line": 9, "column": 39, "offset": 480 } } }, { "type": "text", "value": ":", "position": { "start": { "line": 9, "column": 39, "offset": 480 }, "end": { "line": 9, "column": 40, "offset": 481 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 305 }, "end": { "line": 9, "column": 40, "offset": 481 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "img", "properties": { "src": "/assets/legacy/GetDescendantsExample.png", "alt": "Workspace Descendants" }, "children": [], "position": { "start": { "line": 11, "column": 1, "offset": 483 }, "end": { "line": 11, "column": 67, "offset": 549 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 483 }, "end": { "line": 11, "column": 67, "offset": 549 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Inside this model are three parts (C, D, and E) and another model\n(InnerModel). Inside the inner model are two more parts (A and B). Calling\nGetDescendants on the first model and printing the contents of the\nreturned array would print the first level of children (InnerModel, C, D,\nand E) before A and B.", "position": { "start": { "line": 13, "column": 1, "offset": 551 }, "end": { "line": 17, "column": 23, "offset": 855 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 551 }, "end": { "line": 17, "column": 23, "offset": 855 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local descendants = game.Workspace.Model:GetDescendants()\n\n-- Loop through all of the descendants of the model and\n-- print out their name\nfor index, descendant in pairs(descendants) do\n\tprint(descendant.Name)\nend\n\n-- Prints:\n-- C\n-- D\n-- E\n-- InnerModel\n-- A\n-- B\n" } ], "position": { "start": { "line": 19, "column": 1, "offset": 857 }, "end": { "line": 35, "column": 4, "offset": 1132 } } } ], "position": { "start": { "line": 19, "column": 1, "offset": 857 }, "end": { "line": 35, "column": 4, "offset": 1132 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-GetDescendants1", "displayName": "Instance:GetDescendants", "description": "GetDescendants is often used to do something to all the descendants that are a\nparticular type of object. The code in this example uses GetDescendants and\n`Class.Instance:IsA()` to find all of the parts in the workspace and turns\nthem green.\n", "codeSample": "local descendants = workspace:GetDescendants()\n\n-- Loop through all of the descendants of the Workspace. If a\n-- BasePart is found, the code changes that parts color to green\nfor _, descendant in pairs(descendants) do\n\tif descendant:IsA(\"BasePart\") then\n\t\tdescendant.BrickColor = BrickColor.Green()\n\tend\nend", "expectedOutput": "", "highlightLines": "" } ], "parameters": [], "returns": [ { "type": "Array", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "An array containing the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 25, "offset": 24 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 25, "offset": 24 }, "end": { "line": 1, "column": 41, "offset": 40 } } }, { "type": "text", "value": "'s descendants.", "position": { "start": { "line": 1, "column": 41, "offset": 40 }, "end": { "line": 1, "column": 56, "offset": 55 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 56, "offset": 55 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [ "CUSTOM_LUA_STATE" ], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:GetFullName", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns a string describing the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 33, "offset": 32 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 33, "offset": 32 }, "end": { "line": 1, "column": 49, "offset": 48 } } }, { "type": "text", "value": "'s ancestry.", "position": { "start": { "line": 1, "column": 49, "offset": 48 }, "end": { "line": 1, "column": 61, "offset": 60 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 61, "offset": 60 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns a string describing the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 33, "offset": 32 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 33, "offset": 32 }, "end": { "line": 1, "column": 49, "offset": 48 } } }, { "type": "text", "value": "'s ancestry. The string is\na concatenation of the ", "position": { "start": { "line": 1, "column": 49, "offset": 48 }, "end": { "line": 2, "column": 24, "offset": 98 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name|Name" } ], "position": { "start": { "line": 2, "column": 24, "offset": 98 }, "end": { "line": 2, "column": 50, "offset": 124 } } }, { "type": "text", "value": " of the object and its\nancestors, separated by periods. The ", "position": { "start": { "line": 2, "column": 50, "offset": 124 }, "end": { "line": 3, "column": 38, "offset": 184 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataModel" } ], "position": { "start": { "line": 3, "column": 38, "offset": 184 }, "end": { "line": 3, "column": 55, "offset": 201 } } }, { "type": "text", "value": " (", "position": { "start": { "line": 3, "column": 55, "offset": 201 }, "end": { "line": 3, "column": 57, "offset": 203 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "game" } ], "position": { "start": { "line": 3, "column": 57, "offset": 203 }, "end": { "line": 3, "column": 63, "offset": 209 } } }, { "type": "text", "value": ") is not\nconsidered. For example, a ", "position": { "start": { "line": 3, "column": 63, "offset": 209 }, "end": { "line": 4, "column": 28, "offset": 245 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Part" } ], "position": { "start": { "line": 4, "column": 28, "offset": 245 }, "end": { "line": 4, "column": 40, "offset": 257 } } }, { "type": "text", "value": " in the ", "position": { "start": { "line": 4, "column": 40, "offset": 257 }, "end": { "line": 4, "column": 48, "offset": 265 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Workspace" } ], "position": { "start": { "line": 4, "column": 48, "offset": 265 }, "end": { "line": 4, "column": 65, "offset": 282 } } }, { "type": "text", "value": " may\nreturn ", "position": { "start": { "line": 4, "column": 65, "offset": 282 }, "end": { "line": 5, "column": 8, "offset": 294 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Workspace.Part" } ], "position": { "start": { "line": 5, "column": 8, "offset": 294 }, "end": { "line": 5, "column": 30, "offset": 316 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 5, "column": 30, "offset": 316 }, "end": { "line": 5, "column": 31, "offset": 317 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 5, "column": 31, "offset": 317 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When called on an ", "position": { "start": { "line": 7, "column": 1, "offset": 319 }, "end": { "line": 7, "column": 19, "offset": 337 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 7, "column": 19, "offset": 337 }, "end": { "line": 7, "column": 35, "offset": 353 } } }, { "type": "text", "value": " that is not a descendant of the\n", "position": { "start": { "line": 7, "column": 35, "offset": 353 }, "end": { "line": 8, "column": 1, "offset": 386 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataModel" } ], "position": { "start": { "line": 8, "column": 1, "offset": 386 }, "end": { "line": 8, "column": 18, "offset": 403 } } }, { "type": "text", "value": ", this function considers all ancestors up to and\nincluding the topmost one without a ", "position": { "start": { "line": 8, "column": 18, "offset": 403 }, "end": { "line": 9, "column": 37, "offset": 489 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent|Parent" } ], "position": { "start": { "line": 9, "column": 37, "offset": 489 }, "end": { "line": 9, "column": 67, "offset": 519 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 9, "column": 67, "offset": 519 }, "end": { "line": 9, "column": 68, "offset": 520 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 319 }, "end": { "line": 9, "column": 68, "offset": 520 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function is useful for logging and debugging. You shouldn't attempt\nto parse the returned string for any useful operation; this function does\nnot escape periods (or any other symbol) in object names. In other words,\nalthough its output often appears to be a valid Lua identifier, it is not\nguaranteed.", "position": { "start": { "line": 11, "column": 1, "offset": 522 }, "end": { "line": 15, "column": 12, "offset": 828 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 522 }, "end": { "line": 15, "column": 12, "offset": 828 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-GetFullName1", "displayName": "Instance:GetFullName", "description": "This code sample demonstrates the behavior of `Class.Instance:GetFullName()`.\nIt shows how the function behaves when called on an object not in the\n`DataModel` hierarchy, and it also shows how the return value does not escape\nspecial characters.\n", "codeSample": "-- Create a simple hierarchy\nlocal model = Instance.new(\"Model\")\nlocal part = Instance.new(\"Part\")\npart.Parent = model\nlocal fire = Instance.new(\"Fire\")\nfire.Parent = part\n\nprint(fire:GetFullName()) --> Model.Part.Fire\n\nmodel.Parent = workspace\n\nprint(fire:GetFullName()) --> Workspace.Model.Part.Fire\n\npart.Name = \"Hello, world\"\n\nprint(fire:GetFullName()) --> Workspace.Model.Hello, world.Fire", "expectedOutput": "Model.Part.Fire\nWorkspace.Model.Part.Fire\nWorkspace.Model.Hello, world.Fire", "highlightLines": "5, 7, 9\n" }, { "identifier": "instance-getfullname-lua-implementation", "displayName": "Instance:GetFullName Lua Implementation", "description": "This code sample re-implements the `Class.Instance:GetFullName()` function in\nLua.\n", "codeSample": "local function getFullName(object)\n\tlocal result = object.Name\n\tobject = object.Parent\n\twhile object and object ~= game do\n\t\t-- Prepend parent name\n\t\tresult = object.Name .. \".\" .. result\n\t\t-- Go up the hierarchy\n\t\tobject = object.Parent\n\tend\n\treturn result\nend\n\nprint(getFullName(workspace.Camera)) --> Workspace.Camera", "expectedOutput": "Workspace.Camera", "highlightLines": "12\n" } ], "parameters": [], "returns": [ { "type": "string", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The full name of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 22, "offset": 21 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 22, "offset": 21 }, "end": { "line": 1, "column": 38, "offset": 37 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 38, "offset": 37 }, "end": { "line": 1, "column": 39, "offset": 38 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 39, "offset": 38 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:GetPropertyChangedSignal", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Get an event that fires when a given property of an object changes.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This method returns an event that behaves exactly like the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 60, "offset": 59 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Changed" } ], "position": { "start": { "line": 1, "column": 60, "offset": 59 }, "end": { "line": 1, "column": 69, "offset": 68 } } }, { "type": "text", "value": "\nevent, except that the event only fires when the given property changes.\nIt's generally a good idea to use this method instead of a connection to\n", "position": { "start": { "line": 1, "column": 69, "offset": 68 }, "end": { "line": 4, "column": 1, "offset": 215 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Changed" } ], "position": { "start": { "line": 4, "column": 1, "offset": 215 }, "end": { "line": 4, "column": 10, "offset": 224 } } }, { "type": "text", "value": " with a function that checks the property name. Subsequent calls\nto this method on the same object with the same property name return the\nsame event.", "position": { "start": { "line": 4, "column": 10, "offset": 224 }, "end": { "line": 6, "column": 12, "offset": 373 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 6, "column": 12, "offset": 373 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "print(object:GetPropertyChangedSignal(\"Name\") == object:GetPropertyChangedSignal(\"Name\")) --> always true" } ], "position": { "start": { "line": 8, "column": 1, "offset": 375 }, "end": { "line": 8, "column": 108, "offset": 482 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 375 }, "end": { "line": 8, "column": 108, "offset": 482 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.ValueBase" } ], "position": { "start": { "line": 10, "column": 1, "offset": 484 }, "end": { "line": 10, "column": 18, "offset": 501 } } }, { "type": "text", "value": " objects, such as ", "position": { "start": { "line": 10, "column": 18, "offset": 501 }, "end": { "line": 10, "column": 36, "offset": 519 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.IntValue" } ], "position": { "start": { "line": 10, "column": 36, "offset": 519 }, "end": { "line": 10, "column": 52, "offset": 535 } } }, { "type": "text", "value": " and\n", "position": { "start": { "line": 10, "column": 52, "offset": 535 }, "end": { "line": 11, "column": 1, "offset": 540 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StringValue" } ], "position": { "start": { "line": 11, "column": 1, "offset": 540 }, "end": { "line": 11, "column": 20, "offset": 559 } } }, { "type": "text", "value": ", use a modified ", "position": { "start": { "line": 11, "column": 20, "offset": 559 }, "end": { "line": 11, "column": 37, "offset": 576 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Changed" } ], "position": { "start": { "line": 11, "column": 37, "offset": 576 }, "end": { "line": 11, "column": 46, "offset": 585 } } }, { "type": "text", "value": " event that fires with the\ncontents of the ", "position": { "start": { "line": 11, "column": 46, "offset": 585 }, "end": { "line": 12, "column": 17, "offset": 628 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Value" } ], "position": { "start": { "line": 12, "column": 17, "offset": 628 }, "end": { "line": 12, "column": 24, "offset": 635 } } }, { "type": "text", "value": " property. As such, this method provides a way to\ndetect changes in other properties of those objects. For example, to\ndetect changes in the ", "position": { "start": { "line": 12, "column": 24, "offset": 635 }, "end": { "line": 14, "column": 23, "offset": 776 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Name" } ], "position": { "start": { "line": 14, "column": 23, "offset": 776 }, "end": { "line": 14, "column": 29, "offset": 782 } } }, { "type": "text", "value": " property of an ", "position": { "start": { "line": 14, "column": 29, "offset": 782 }, "end": { "line": 14, "column": 45, "offset": 798 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.IntValue" } ], "position": { "start": { "line": 14, "column": 45, "offset": 798 }, "end": { "line": 14, "column": 61, "offset": 814 } } }, { "type": "text", "value": ", use\n", "position": { "start": { "line": 14, "column": 61, "offset": 814 }, "end": { "line": 15, "column": 1, "offset": 820 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "IntValue:GetPropertyChangedSignal(\"Name\"):Connect(someFunc)" } ], "position": { "start": { "line": 15, "column": 1, "offset": 820 }, "end": { "line": 15, "column": 62, "offset": 881 } } }, { "type": "text", "value": " since the\n", "position": { "start": { "line": 15, "column": 62, "offset": 881 }, "end": { "line": 16, "column": 1, "offset": 892 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Changed" } ], "position": { "start": { "line": 16, "column": 1, "offset": 892 }, "end": { "line": 16, "column": 10, "offset": 901 } } }, { "type": "text", "value": " event of ", "position": { "start": { "line": 16, "column": 10, "offset": 901 }, "end": { "line": 16, "column": 20, "offset": 911 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.IntValue" } ], "position": { "start": { "line": 16, "column": 20, "offset": 911 }, "end": { "line": 16, "column": 36, "offset": 927 } } }, { "type": "text", "value": " objects only detect changes on the\n", "position": { "start": { "line": 16, "column": 36, "offset": 927 }, "end": { "line": 17, "column": 1, "offset": 963 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Value" } ], "position": { "start": { "line": 17, "column": 1, "offset": 963 }, "end": { "line": 17, "column": 8, "offset": 970 } } }, { "type": "text", "value": " property.", "position": { "start": { "line": 17, "column": 8, "offset": 970 }, "end": { "line": 17, "column": 18, "offset": 980 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 484 }, "end": { "line": 17, "column": 18, "offset": 980 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Changed-Old-to-New", "displayName": "Old-to-New Values with Changed", "description": "This code sample demonstrates how to save a value before a changed event fires\non it in order to get more information about a change.\n", "codeSample": "local part = Instance.new(\"Part\")\n\nlocal currentColor = part.BrickColor\n\nlocal function onBrickColorChanged()\n\tlocal newColor = part.BrickColor\n\tprint(\"Color changed from\", currentColor.Name, \"to\", newColor.Name)\n\tcurrentColor = newColor\nend\npart:GetPropertyChangedSignal(\"BrickColor\"):Connect(onBrickColorChanged)\n\npart.BrickColor = BrickColor.new(\"Really red\")\npart.BrickColor = BrickColor.new(\"Really blue\")", "expectedOutput": "", "highlightLines": "" }, { "identifier": "Changed-and-GetPropertyChangedSignal", "displayName": "Changed and GetPropertyChangedSignal", "description": "This code sample demonstrates the equivalence of the `Changed` event and event\nreturned by `GetPropertyChangedSignal`.\n", "codeSample": "local part = Instance.new(\"Part\")\n\nlocal function onBrickColorChanged()\n\tprint(\"My color is now \" .. part.BrickColor.Name)\nend\n\nlocal function onChanged(property)\n\tif property == \"BrickColor\" then\n\t\tonBrickColorChanged()\n\tend\nend\n\npart:GetPropertyChangedSignal(\"BrickColor\"):Connect(onBrickColorChanged)\npart.Changed:Connect(onChanged)\n\n-- Trigger some changes (because we connected twice,\n-- both of these will cause two calls to onBrickColorChanged)\npart.BrickColor = BrickColor.new(\"Really red\")\npart.BrickColor = BrickColor.new(\"Institutional white\")", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "property", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The property to connect to.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "RBXScriptSignal", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "A signal that fires whenever the property changes.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 51, "offset": 50 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 51, "offset": 50 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:GetTags", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Gets an array of all tags applied to the instance.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 51, "offset": 50 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 51, "offset": 50 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This method returns an array of the tags applied to the given instance, as\nstrings. You can add tags either in Studio in the\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 125 } } }, { "type": "element", "tagName": "a", "properties": { "href": "../../../studio/properties.md" }, "children": [ { "type": "text", "value": "Properties", "position": { "start": { "line": 3, "column": 2, "offset": 126 }, "end": { "line": 3, "column": 12, "offset": 136 } } } ], "position": { "start": { "line": 3, "column": 1, "offset": 125 }, "end": { "line": 3, "column": 44, "offset": 168 } } }, { "type": "text", "value": " window or at runtime with\n", "position": { "start": { "line": 3, "column": 44, "offset": 168 }, "end": { "line": 4, "column": 1, "offset": 195 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:AddTag()|AddTag()" } ], "position": { "start": { "line": 4, "column": 1, "offset": 195 }, "end": { "line": 4, "column": 35, "offset": 229 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 4, "column": 35, "offset": 229 }, "end": { "line": 4, "column": 36, "offset": 230 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 36, "offset": 230 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This method is useful when you want to do something with multiple tags on\nan instance at once. However, it is inefficient to use this method to\ncheck for the existence of a single tag; instead, use\n", "position": { "start": { "line": 6, "column": 1, "offset": 232 }, "end": { "line": 9, "column": 1, "offset": 430 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:HasTag()|HasTag()" } ], "position": { "start": { "line": 9, "column": 1, "offset": 430 }, "end": { "line": 9, "column": 35, "offset": 464 } } }, { "type": "text", "value": " to check for a specific tag.", "position": { "start": { "line": 9, "column": 35, "offset": 464 }, "end": { "line": 9, "column": 64, "offset": 493 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 232 }, "end": { "line": 9, "column": 64, "offset": 493 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [], "parameters": [], "returns": [ { "type": "Array", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:HasTag", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Check whether the instance has a given tag.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This method returns ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "true" } ], "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 27, "offset": 26 } } }, { "type": "text", "value": " if the provided tag has been added to the\nobject. You can add tags either in Studio in the\n", "position": { "start": { "line": 1, "column": 27, "offset": 26 }, "end": { "line": 3, "column": 1, "offset": 118 } } }, { "type": "element", "tagName": "a", "properties": { "href": "../../../studio/properties.md" }, "children": [ { "type": "text", "value": "Properties", "position": { "start": { "line": 3, "column": 2, "offset": 119 }, "end": { "line": 3, "column": 12, "offset": 129 } } } ], "position": { "start": { "line": 3, "column": 1, "offset": 118 }, "end": { "line": 3, "column": 44, "offset": 161 } } }, { "type": "text", "value": " window or at runtime with\n", "position": { "start": { "line": 3, "column": 44, "offset": 161 }, "end": { "line": 4, "column": 1, "offset": 188 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:AddTag()|AddTag()" } ], "position": { "start": { "line": 4, "column": 1, "offset": 188 }, "end": { "line": 4, "column": 35, "offset": 222 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 4, "column": 35, "offset": 222 }, "end": { "line": 4, "column": 36, "offset": 223 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 36, "offset": 223 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [], "parameters": [ { "name": "tag", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "bool", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:IsA", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns true if an ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 20, "offset": 19 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 20, "offset": 19 }, "end": { "line": 1, "column": 36, "offset": 35 } } }, { "type": "text", "value": "'s class matches or inherits from a\ngiven class.", "position": { "start": { "line": 1, "column": 36, "offset": 35 }, "end": { "line": 2, "column": 13, "offset": 83 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 13, "offset": 83 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "IsA returns true if the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 25, "offset": 24 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 25, "offset": 24 }, "end": { "line": 1, "column": 41, "offset": 40 } } }, { "type": "text", "value": "'s class is ", "position": { "start": { "line": 1, "column": 41, "offset": 40 }, "end": { "line": 1, "column": 53, "offset": 52 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "equivalent to", "position": { "start": { "line": 1, "column": 55, "offset": 54 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "position": { "start": { "line": 1, "column": 53, "offset": 52 }, "end": { "line": 1, "column": 70, "offset": 69 } } }, { "type": "text", "value": " or a\n", "position": { "start": { "line": 1, "column": 70, "offset": 69 }, "end": { "line": 2, "column": 1, "offset": 75 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "subclass", "position": { "start": { "line": 2, "column": 3, "offset": 77 }, "end": { "line": 2, "column": 11, "offset": 85 } } } ], "position": { "start": { "line": 2, "column": 1, "offset": 75 }, "end": { "line": 2, "column": 13, "offset": 87 } } }, { "type": "text", "value": " of a given class. This function is similar to the\n", "position": { "start": { "line": 2, "column": 13, "offset": 87 }, "end": { "line": 3, "column": 1, "offset": 138 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "instanceof", "position": { "start": { "line": 3, "column": 3, "offset": 140 }, "end": { "line": 3, "column": 13, "offset": 150 } } } ], "position": { "start": { "line": 3, "column": 1, "offset": 138 }, "end": { "line": 3, "column": 15, "offset": 152 } } }, { "type": "text", "value": " operators in other languages, and is a form of\n", "position": { "start": { "line": 3, "column": 15, "offset": 152 }, "end": { "line": 4, "column": 1, "offset": 200 } } }, { "type": "element", "tagName": "a", "properties": { "href": "https://en.wikipedia.org/wiki/Type_introspection" }, "children": [ { "type": "text", "value": "type introspection", "position": { "start": { "line": 4, "column": 2, "offset": 201 }, "end": { "line": 4, "column": 20, "offset": 219 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 200 }, "end": { "line": 4, "column": 71, "offset": 270 } } }, { "type": "text", "value": ". To\nignore class inheritance, test the ", "position": { "start": { "line": 4, "column": 71, "offset": 270 }, "end": { "line": 5, "column": 36, "offset": 310 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ClassName|ClassName" } ], "position": { "start": { "line": 5, "column": 36, "offset": 310 }, "end": { "line": 5, "column": 72, "offset": 346 } } }, { "type": "text", "value": "\nproperty directly instead. For checking native Lua data types (number,\nstring, etc) use the functions ", "position": { "start": { "line": 5, "column": 72, "offset": 346 }, "end": { "line": 7, "column": 32, "offset": 449 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "type" } ], "position": { "start": { "line": 7, "column": 32, "offset": 449 }, "end": { "line": 7, "column": 38, "offset": 455 } } }, { "type": "text", "value": " and ", "position": { "start": { "line": 7, "column": 38, "offset": 455 }, "end": { "line": 7, "column": 43, "offset": 460 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "typeof" } ], "position": { "start": { "line": 7, "column": 43, "offset": 460 }, "end": { "line": 7, "column": 51, "offset": 468 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 7, "column": 51, "offset": 468 }, "end": { "line": 7, "column": 52, "offset": 469 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 7, "column": 52, "offset": 469 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Most commonly, this function is used to test if an object is some kind of\npart, such as ", "position": { "start": { "line": 9, "column": 1, "offset": 471 }, "end": { "line": 10, "column": 15, "offset": 559 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Part" } ], "position": { "start": { "line": 10, "column": 15, "offset": 559 }, "end": { "line": 10, "column": 27, "offset": 571 } } }, { "type": "text", "value": " or ", "position": { "start": { "line": 10, "column": 27, "offset": 571 }, "end": { "line": 10, "column": 31, "offset": 575 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.WedgePart" } ], "position": { "start": { "line": 10, "column": 31, "offset": 575 }, "end": { "line": 10, "column": 48, "offset": 592 } } }, { "type": "text", "value": ", which inherits from\n", "position": { "start": { "line": 10, "column": 48, "offset": 592 }, "end": { "line": 11, "column": 1, "offset": 614 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.BasePart" } ], "position": { "start": { "line": 11, "column": 1, "offset": 614 }, "end": { "line": 11, "column": 17, "offset": 630 } } }, { "type": "text", "value": " (an abstract class). For example, if your goal is to\nchange all of a ", "position": { "start": { "line": 11, "column": 17, "offset": 630 }, "end": { "line": 12, "column": 17, "offset": 700 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Player.Character|Character" } ], "position": { "start": { "line": 12, "column": 17, "offset": 700 }, "end": { "line": 12, "column": 51, "offset": 734 } } }, { "type": "text", "value": "'s limbs to the same\ncolor, you might use ", "position": { "start": { "line": 12, "column": 51, "offset": 734 }, "end": { "line": 13, "column": 22, "offset": 776 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetChildren()|GetChildren" } ], "position": { "start": { "line": 13, "column": 22, "offset": 776 }, "end": { "line": 13, "column": 64, "offset": 818 } } }, { "type": "text", "value": " to iterate\nover the children, then use IsA to filter non-", "position": { "start": { "line": 13, "column": 64, "offset": 818 }, "end": { "line": 14, "column": 47, "offset": 876 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.BasePart" } ], "position": { "start": { "line": 14, "column": 47, "offset": 876 }, "end": { "line": 14, "column": 63, "offset": 892 } } }, { "type": "text", "value": " objects\nwhich lack the ", "position": { "start": { "line": 14, "column": 63, "offset": 892 }, "end": { "line": 15, "column": 16, "offset": 916 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Datatype.BrickColor" } ], "position": { "start": { "line": 15, "column": 16, "offset": 916 }, "end": { "line": 15, "column": 37, "offset": 937 } } }, { "type": "text", "value": " property:", "position": { "start": { "line": 15, "column": 37, "offset": 937 }, "end": { "line": 15, "column": 47, "offset": 947 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 471 }, "end": { "line": 15, "column": 47, "offset": 947 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local function paintFigure(character, color)\n\t-- Iterate over the child objects of the character\n\tfor _, child in pairs(character:GetChildren()) do\n\t\t-- Filter out non-part objects, such as Shirt, Pants and Humanoid\n\t\t-- R15 use MeshPart and R6 use Part, so we use BasePart here to detect both:\n\t\tif child:IsA(\"BasePart\") then\n\t\t\tchild.BrickColor = color\n\t\tend\n\tend\nend\npaintFigure(game.Players.Player.Character, BrickColor.new(\"Bright blue\"))\n" } ], "position": { "start": { "line": 17, "column": 1, "offset": 949 }, "end": { "line": 29, "column": 4, "offset": 1403 } } } ], "position": { "start": { "line": 17, "column": 1, "offset": 949 }, "end": { "line": 29, "column": 4, "offset": 1403 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Since all classes inherit from ", "position": { "start": { "line": 31, "column": 1, "offset": 1405 }, "end": { "line": 31, "column": 32, "offset": 1436 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 31, "column": 32, "offset": 1436 }, "end": { "line": 31, "column": 48, "offset": 1452 } } }, { "type": "text", "value": ", calling\n", "position": { "start": { "line": 31, "column": 48, "offset": 1452 }, "end": { "line": 32, "column": 1, "offset": 1462 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "object:IsA(\"Instance\")" } ], "position": { "start": { "line": 32, "column": 1, "offset": 1462 }, "end": { "line": 32, "column": 25, "offset": 1486 } } }, { "type": "text", "value": " will always return true.", "position": { "start": { "line": 32, "column": 25, "offset": 1486 }, "end": { "line": 32, "column": 50, "offset": 1511 } } } ], "position": { "start": { "line": 31, "column": 1, "offset": 1405 }, "end": { "line": 32, "column": 50, "offset": 1511 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-IsA1", "displayName": "Instance:IsA", "description": "Usage of IsA to test class inheritance:\n", "codeSample": "print(workspace:IsA(\"Instance\")) --> true\nprint(workspace:IsA(\"Workspace\")) --> true\nprint(game:IsA(\"workspace\")) --> false\nprint(game:IsA(\"DataModel\")) --> true", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "className", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The class against which the Instance's class will be checked.\nCase-sensitive.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 16, "offset": 77 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 16, "offset": 77 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "bool", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Describes whether the Instance's class matched or is a subclass of the\ngiven class.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 13, "offset": 83 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 13, "offset": 83 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [ "CUSTOM_LUA_STATE" ], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:IsAncestorOf", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns true if an ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 20, "offset": 19 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 20, "offset": 19 }, "end": { "line": 1, "column": 36, "offset": 35 } } }, { "type": "text", "value": " is an ancestor of the given\ndescendant.", "position": { "start": { "line": 1, "column": 36, "offset": 35 }, "end": { "line": 2, "column": 12, "offset": 75 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 12, "offset": 75 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns true if an ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 20, "offset": 19 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 20, "offset": 19 }, "end": { "line": 1, "column": 36, "offset": 35 } } }, { "type": "text", "value": " is an ancestor of the given\ndescendant.", "position": { "start": { "line": 1, "column": 36, "offset": 35 }, "end": { "line": 2, "column": 12, "offset": 75 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 12, "offset": 75 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "An ", "position": { "start": { "line": 4, "column": 1, "offset": 77 }, "end": { "line": 4, "column": 4, "offset": 80 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 4, "column": 4, "offset": 80 }, "end": { "line": 4, "column": 20, "offset": 96 } } }, { "type": "text", "value": " is considered the ancestor of an object if the\nobject's ", "position": { "start": { "line": 4, "column": 20, "offset": 96 }, "end": { "line": 5, "column": 10, "offset": 153 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 5, "column": 10, "offset": 153 }, "end": { "line": 5, "column": 33, "offset": 176 } } }, { "type": "text", "value": " or one of it's parent's\n", "position": { "start": { "line": 5, "column": 33, "offset": 176 }, "end": { "line": 6, "column": 1, "offset": 201 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 6, "column": 1, "offset": 201 }, "end": { "line": 6, "column": 24, "offset": 224 } } }, { "type": "text", "value": " is set to the ", "position": { "start": { "line": 6, "column": 24, "offset": 224 }, "end": { "line": 6, "column": 39, "offset": 239 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 6, "column": 39, "offset": 239 }, "end": { "line": 6, "column": 55, "offset": 255 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 6, "column": 55, "offset": 255 }, "end": { "line": 6, "column": 56, "offset": 256 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 77 }, "end": { "line": 6, "column": 56, "offset": 256 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also, ", "position": { "start": { "line": 8, "column": 1, "offset": 258 }, "end": { "line": 8, "column": 11, "offset": 268 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsDescendantOf()" } ], "position": { "start": { "line": 8, "column": 11, "offset": 268 }, "end": { "line": 8, "column": 44, "offset": 301 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 8, "column": 44, "offset": 301 }, "end": { "line": 8, "column": 45, "offset": 302 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 258 }, "end": { "line": 8, "column": 45, "offset": 302 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-IsAncestorOf1", "displayName": "Instance:IsAncestorOf", "description": "", "codeSample": "print(workspace:IsAncestorOf(workspace.Player.HumanoidRootPart)) --> true", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "descendant", "type": "Instance", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The descendant ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 16, "offset": 15 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 16, "offset": 15 }, "end": { "line": 1, "column": 32, "offset": 31 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 32, "offset": 31 }, "end": { "line": 1, "column": 33, "offset": 32 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 33, "offset": 32 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "bool", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "True if the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 13, "offset": 12 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 13, "offset": 12 }, "end": { "line": 1, "column": 29, "offset": 28 } } }, { "type": "text", "value": " is an ancestor of the given descendant.", "position": { "start": { "line": 1, "column": 29, "offset": 28 }, "end": { "line": 1, "column": 69, "offset": 68 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 69, "offset": 68 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:IsDescendantOf", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns true if an ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 20, "offset": 19 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 20, "offset": 19 }, "end": { "line": 1, "column": 36, "offset": 35 } } }, { "type": "text", "value": " is a descendant of the given ancestor.", "position": { "start": { "line": 1, "column": 36, "offset": 35 }, "end": { "line": 1, "column": 75, "offset": 74 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 75, "offset": 74 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns true if an ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 20, "offset": 19 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 20, "offset": 19 }, "end": { "line": 1, "column": 36, "offset": 35 } } }, { "type": "text", "value": " is a descendant of the given ancestor.", "position": { "start": { "line": 1, "column": 36, "offset": 35 }, "end": { "line": 1, "column": 75, "offset": 74 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 75, "offset": 74 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "An ", "position": { "start": { "line": 3, "column": 1, "offset": 76 }, "end": { "line": 3, "column": 4, "offset": 79 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 3, "column": 4, "offset": 79 }, "end": { "line": 3, "column": 20, "offset": 95 } } }, { "type": "text", "value": " is considered the descendant of an object if the\n", "position": { "start": { "line": 3, "column": 20, "offset": 95 }, "end": { "line": 4, "column": 1, "offset": 145 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 4, "column": 1, "offset": 145 }, "end": { "line": 4, "column": 17, "offset": 161 } } }, { "type": "text", "value": "'s parent or one of its parent's parent is set to the\nobject.", "position": { "start": { "line": 4, "column": 17, "offset": 161 }, "end": { "line": 5, "column": 8, "offset": 222 } } } ], "position": { "start": { "line": 3, "column": 1, "offset": 76 }, "end": { "line": 5, "column": 8, "offset": 222 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note, ", "position": { "start": { "line": 7, "column": 1, "offset": 224 }, "end": { "line": 7, "column": 7, "offset": 230 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.DataModel" } ], "position": { "start": { "line": 7, "column": 7, "offset": 230 }, "end": { "line": 7, "column": 24, "offset": 247 } } }, { "type": "text", "value": " is a descendant of nil. This means IsDescendantOf\ncannot be used with a parameter of nil to check if an object has been\nremoved.", "position": { "start": { "line": 7, "column": 24, "offset": 247 }, "end": { "line": 9, "column": 9, "offset": 376 } } } ], "position": { "start": { "line": 7, "column": 1, "offset": 224 }, "end": { "line": 9, "column": 9, "offset": 376 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also, ", "position": { "start": { "line": 11, "column": 1, "offset": 378 }, "end": { "line": 11, "column": 11, "offset": 388 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsAncestorOf()" } ], "position": { "start": { "line": 11, "column": 11, "offset": 388 }, "end": { "line": 11, "column": 42, "offset": 419 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 11, "column": 42, "offset": 419 }, "end": { "line": 11, "column": 43, "offset": 420 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 378 }, "end": { "line": 11, "column": 43, "offset": 420 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-IsDescendantOf1", "displayName": "Instance:IsDescendantOf", "description": "", "codeSample": "local part = Instance.new(\"Part\")\nprint(part:IsDescendantOf(game))\n--> false\n\npart.Parent = workspace\nprint(part:IsDescendantOf(game))\n--> true\n\npart.Parent = game\nprint(part:IsDescendantOf(game))\n--> true", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "ancestor", "type": "Instance", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ancestor ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 14, "offset": 13 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 14, "offset": 13 }, "end": { "line": 1, "column": 30, "offset": 29 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 30, "offset": 29 }, "end": { "line": 1, "column": 31, "offset": 30 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 31, "offset": 30 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "bool", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "True if the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 13, "offset": 12 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 13, "offset": 12 }, "end": { "line": 1, "column": 29, "offset": 28 } } }, { "type": "text", "value": " is a descendant of the given ancestor.", "position": { "start": { "line": 1, "column": 29, "offset": 28 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 68, "offset": 67 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "SAFE", "__typename": "Method" }, { "name": "Instance:Remove", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Sets the object's Parent to nil, and does the same for all its\ndescendants.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 13, "offset": 75 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 13, "offset": 75 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The Remove function sets the object's ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 39, "offset": 38 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 1, "column": 39, "offset": 38 }, "end": { "line": 1, "column": 62, "offset": 61 } } }, { "type": "text", "value": " to nil, and\ndoes the same for all its descendants.", "position": { "start": { "line": 1, "column": 62, "offset": 61 }, "end": { "line": 2, "column": 39, "offset": 112 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 39, "offset": 112 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If the object is referenced before being removed it is possible to\nretrieve the object at a later point.", "position": { "start": { "line": 4, "column": 1, "offset": 114 }, "end": { "line": 5, "column": 38, "offset": 218 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 114 }, "end": { "line": 5, "column": 38, "offset": 218 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-Remove1", "displayName": "Instance:Remove", "description": "The following code demonstrates how a part can be re-added to the DataModel\nafter being removed:\n", "codeSample": "local part = Instance.new(\"Part\")\npart.Parent = workspace\nprint(part.Parent) --> Workspace\n\npart:Remove()\n\nprint(part.Parent) --> nil\n\npart.Parent = workspace\n\nprint(part.Parent) --> Workspace", "expectedOutput": "", "highlightLines": "" } ], "parameters": [], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item is deprecated in favor of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 37, "offset": 36 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Destroy()" } ], "position": { "start": { "line": 1, "column": 37, "offset": 36 }, "end": { "line": 1, "column": 63, "offset": 62 } } }, { "type": "text", "value": " and\n", "position": { "start": { "line": 1, "column": 63, "offset": 62 }, "end": { "line": 2, "column": 1, "offset": 67 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:ClearAllChildren()" } ], "position": { "start": { "line": 2, "column": 1, "offset": 67 }, "end": { "line": 2, "column": 36, "offset": 102 } } }, { "type": "text", "value": ". If you must remove an object from the\ngame, and wish to use the object later, set its Parent property to nil\ninstead of using this method.", "position": { "start": { "line": 2, "column": 36, "offset": 102 }, "end": { "line": 4, "column": 30, "offset": 242 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 30, "offset": 242 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:RemoveTag", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Removes a tag from the instance.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 33, "offset": 32 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 33, "offset": 32 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This method removes a tag from an instance. It will not throw an error if\nthe object does not have the tag. Successfully removing a tag will fire a\nsignal created by ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 19, "offset": 166 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.CollectionService:GetInstanceRemovedSignal()" } ], "position": { "start": { "line": 3, "column": 19, "offset": 166 }, "end": { "line": 3, "column": 71, "offset": 218 } } }, { "type": "text", "value": "\nwith the given tag.", "position": { "start": { "line": 3, "column": 71, "offset": 218 }, "end": { "line": 4, "column": 20, "offset": 238 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 20, "offset": 238 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note that when tagging an instance, it's common that some resources are\nused to give the tag its functionality, for example event connections or\ntables. To prevent memory leaks, it's a good idea to clean these up\n(disconnect, set to ", "position": { "start": { "line": 6, "column": 1, "offset": 240 }, "end": { "line": 9, "column": 21, "offset": 473 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "nil" } ], "position": { "start": { "line": 9, "column": 21, "offset": 473 }, "end": { "line": 9, "column": 26, "offset": 478 } } }, { "type": "text", "value": ", etc.) when no longer needed for a tag.", "position": { "start": { "line": 9, "column": 26, "offset": 478 }, "end": { "line": 9, "column": 66, "offset": 518 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 240 }, "end": { "line": 9, "column": 66, "offset": 518 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [], "parameters": [ { "name": "tag", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:SetAttribute", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Sets the attribute with the given name to the given value.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function sets the attribute with the given name to the given value.\nIf the value given is nil, then the attribute will be removed (since nil\nis returned by default).", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 25, "offset": 170 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 25, "offset": 170 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "For example, the following code snippet will set the instance's\n", "position": { "start": { "line": 5, "column": 1, "offset": 172 }, "end": { "line": 6, "column": 1, "offset": 236 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "InitialPosition" } ], "position": { "start": { "line": 6, "column": 1, "offset": 236 }, "end": { "line": 6, "column": 18, "offset": 253 } } }, { "type": "text", "value": " attribute to ", "position": { "start": { "line": 6, "column": 18, "offset": 253 }, "end": { "line": 6, "column": 32, "offset": 267 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Datatype.Vector3|Vector3.new(0, 0, 0)" } ], "position": { "start": { "line": 6, "column": 32, "offset": 267 }, "end": { "line": 6, "column": 71, "offset": 306 } } }, { "type": "text", "value": ".\nNote that this code sample does not define ", "position": { "start": { "line": 6, "column": 71, "offset": 306 }, "end": { "line": 7, "column": 44, "offset": 351 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 7, "column": 44, "offset": 351 }, "end": { "line": 7, "column": 60, "offset": 367 } } }, { "type": "text", "value": ":", "position": { "start": { "line": 7, "column": 60, "offset": 367 }, "end": { "line": 7, "column": 61, "offset": 368 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 172 }, "end": { "line": 7, "column": 61, "offset": 368 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "instance:SetAttribute(\"InitialPosition\", Vector3.new(0, 0, 0))\n" } ], "position": { "start": { "line": 9, "column": 1, "offset": 370 }, "end": { "line": 11, "column": 4, "offset": 443 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 370 }, "end": { "line": 11, "column": 4, "offset": 443 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Limitations", "position": { "start": { "line": 13, "column": 6, "offset": 450 }, "end": { "line": 13, "column": 17, "offset": 461 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 445 }, "end": { "line": 13, "column": 17, "offset": 461 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Naming requirements and restrictions:", "position": { "start": { "line": 15, "column": 1, "offset": 463 }, "end": { "line": 15, "column": 38, "offset": 500 } } } ], "position": { "start": { "line": 15, "column": 1, "offset": 463 }, "end": { "line": 15, "column": 38, "offset": 500 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Names must only use alphanumeric characters and underscore", "position": { "start": { "line": 17, "column": 3, "offset": 504 }, "end": { "line": 17, "column": 61, "offset": 562 } } } ], "position": { "start": { "line": 17, "column": 1, "offset": 502 }, "end": { "line": 17, "column": 61, "offset": 562 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "No spaces or unique symbols are allowed", "position": { "start": { "line": 18, "column": 3, "offset": 565 }, "end": { "line": 18, "column": 42, "offset": 604 } } } ], "position": { "start": { "line": 18, "column": 1, "offset": 563 }, "end": { "line": 18, "column": 42, "offset": 604 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Strings must be 100 characters or less", "position": { "start": { "line": 19, "column": 3, "offset": 607 }, "end": { "line": 19, "column": 41, "offset": 645 } } } ], "position": { "start": { "line": 19, "column": 1, "offset": 605 }, "end": { "line": 19, "column": 41, "offset": 645 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Names are not allowed to start with RBX unless the caller is a Roblox\ncore-script (reserved for Roblox)", "position": { "start": { "line": 20, "column": 3, "offset": 648 }, "end": { "line": 21, "column": 36, "offset": 753 } } } ], "position": { "start": { "line": 20, "column": 1, "offset": 646 }, "end": { "line": 21, "column": 36, "offset": 753 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 17, "column": 1, "offset": 502 }, "end": { "line": 21, "column": 36, "offset": 753 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When attempting to set an attribute to an unsupported type, an error will\nbe thrown.", "position": { "start": { "line": 23, "column": 1, "offset": 755 }, "end": { "line": 24, "column": 11, "offset": 839 } } } ], "position": { "start": { "line": 23, "column": 1, "offset": 755 }, "end": { "line": 24, "column": 11, "offset": 839 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also:", "position": { "start": { "line": 26, "column": 1, "offset": 841 }, "end": { "line": 26, "column": 10, "offset": 850 } } } ], "position": { "start": { "line": 26, "column": 1, "offset": 841 }, "end": { "line": 26, "column": 10, "offset": 850 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetAttribute()" } ], "position": { "start": { "line": 28, "column": 3, "offset": 854 }, "end": { "line": 28, "column": 34, "offset": 885 } } }, { "type": "text", "value": ", returns the attribute which has been\nassigned to the given name", "position": { "start": { "line": 28, "column": 34, "offset": 885 }, "end": { "line": 29, "column": 29, "offset": 952 } } } ], "position": { "start": { "line": 28, "column": 1, "offset": 852 }, "end": { "line": 29, "column": 29, "offset": 952 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetAttributes()" } ], "position": { "start": { "line": 30, "column": 3, "offset": 955 }, "end": { "line": 30, "column": 35, "offset": 987 } } }, { "type": "text", "value": ", returns a dictionary of string →\nvariant pairs for each of the instance's attributes", "position": { "start": { "line": 30, "column": 35, "offset": 987 }, "end": { "line": 31, "column": 54, "offset": 1075 } } } ], "position": { "start": { "line": 30, "column": 1, "offset": 953 }, "end": { "line": 31, "column": 54, "offset": 1075 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.AttributeChanged" } ], "position": { "start": { "line": 32, "column": 3, "offset": 1078 }, "end": { "line": 32, "column": 36, "offset": 1111 } } }, { "type": "text", "value": ", fires whenever an attribute is\nchanged on the instance", "position": { "start": { "line": 32, "column": 36, "offset": 1111 }, "end": { "line": 33, "column": 26, "offset": 1169 } } } ], "position": { "start": { "line": 32, "column": 1, "offset": 1076 }, "end": { "line": 33, "column": 26, "offset": 1169 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetAttributeChangedSignal()" } ], "position": { "start": { "line": 34, "column": 3, "offset": 1172 }, "end": { "line": 34, "column": 47, "offset": 1216 } } }, { "type": "text", "value": ", returns an event that\nfires when the given attribute changes", "position": { "start": { "line": 34, "column": 47, "offset": 1216 }, "end": { "line": 35, "column": 41, "offset": 1280 } } } ], "position": { "start": { "line": 34, "column": 1, "offset": 1170 }, "end": { "line": 35, "column": 41, "offset": 1280 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 28, "column": 1, "offset": 852 }, "end": { "line": 35, "column": 41, "offset": 1280 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "attribute", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The name of the attribute being set.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 37, "offset": 36 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 37, "offset": 36 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } }, { "name": "value", "type": "Variant", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The value that the specified attribute is being set to.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 56, "offset": 55 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 56, "offset": 55 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "void", "summary": "" } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:WaitForChild", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the child of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 26, "offset": 25 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 26, "offset": 25 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "text", "value": " with the given name. If the\nchild does not exist, it will yield the current thread until it does.", "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 2, "column": 70, "offset": 139 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 70, "offset": 139 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns the child of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 26, "offset": 25 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 26, "offset": 25 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "text", "value": " with the given name. If the\nchild does not exist, it will yield the current thread until it does. If\nthe ", "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 3, "column": 5, "offset": 147 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "timeOut" } ], "position": { "start": { "line": 3, "column": 5, "offset": 147 }, "end": { "line": 3, "column": 14, "offset": 156 } } }, { "type": "text", "value": " parameter is specified, this method will time out after the\nspecified number of seconds and return ", "position": { "start": { "line": 3, "column": 14, "offset": 156 }, "end": { "line": 4, "column": 40, "offset": 256 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "nil" } ], "position": { "start": { "line": 4, "column": 40, "offset": 256 }, "end": { "line": 4, "column": 45, "offset": 261 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 4, "column": 45, "offset": 261 }, "end": { "line": 4, "column": 46, "offset": 262 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 46, "offset": 262 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Primary Usage", "position": { "start": { "line": 6, "column": 6, "offset": 269 }, "end": { "line": 6, "column": 19, "offset": 282 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 264 }, "end": { "line": 6, "column": 19, "offset": 282 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:WaitForChild()|WaitForChild()" } ], "position": { "start": { "line": 8, "column": 1, "offset": 284 }, "end": { "line": 8, "column": 47, "offset": 330 } } }, { "type": "text", "value": " is extremely important when\nworking on code run by the client in a ", "position": { "start": { "line": 8, "column": 47, "offset": 330 }, "end": { "line": 9, "column": 40, "offset": 398 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.LocalScript" } ], "position": { "start": { "line": 9, "column": 40, "offset": 398 }, "end": { "line": 9, "column": 59, "offset": 417 } } }, { "type": "text", "value": ". The Roblox\nengine does not guarantee the time or order in which objects are\nreplicated from the server to the client. Additionally, if an experience\nhas ", "position": { "start": { "line": 9, "column": 59, "offset": 417 }, "end": { "line": 12, "column": 5, "offset": 572 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Workspace.StreamingEnabled" } ], "position": { "start": { "line": 12, "column": 5, "offset": 572 }, "end": { "line": 12, "column": 39, "offset": 606 } } }, { "type": "text", "value": " set to true,\n", "position": { "start": { "line": 12, "column": 39, "offset": 606 }, "end": { "line": 13, "column": 1, "offset": 620 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.BasePart|BaseParts" } ], "position": { "start": { "line": 13, "column": 1, "offset": 620 }, "end": { "line": 13, "column": 27, "offset": 646 } } }, { "type": "text", "value": " that are far away from the player's character\nmay not be streamed to the client, potentially causing scripts to break\nwhen indexing objects that do not yet exist on the client.", "position": { "start": { "line": 13, "column": 27, "offset": 646 }, "end": { "line": 15, "column": 59, "offset": 823 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 284 }, "end": { "line": 15, "column": 59, "offset": 823 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Notes", "position": { "start": { "line": 17, "column": 6, "offset": 830 }, "end": { "line": 17, "column": 11, "offset": 835 } } } ], "position": { "start": { "line": 17, "column": 1, "offset": 825 }, "end": { "line": 17, "column": 11, "offset": 835 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function does not yield if a child with the given name exists when\nthe call is made.", "position": { "start": { "line": 19, "column": 3, "offset": 839 }, "end": { "line": 20, "column": 20, "offset": 930 } } } ], "position": { "start": { "line": 19, "column": 3, "offset": 839 }, "end": { "line": 20, "column": 20, "offset": 930 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 19, "column": 1, "offset": 837 }, "end": { "line": 20, "column": 20, "offset": 930 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstChild()" } ], "position": { "start": { "line": 21, "column": 3, "offset": 933 }, "end": { "line": 21, "column": 36, "offset": 966 } } }, { "type": "text", "value": " is a more efficient alternative to\n", "position": { "start": { "line": 21, "column": 36, "offset": 966 }, "end": { "line": 22, "column": 1, "offset": 1002 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:WaitForChild()|WaitForChild()" } ], "position": { "start": { "line": 22, "column": 3, "offset": 1004 }, "end": { "line": 22, "column": 49, "offset": 1050 } } }, { "type": "text", "value": " for objects that are\nassumed to exist.", "position": { "start": { "line": 22, "column": 49, "offset": 1050 }, "end": { "line": 23, "column": 20, "offset": 1091 } } } ], "position": { "start": { "line": 21, "column": 3, "offset": 933 }, "end": { "line": 23, "column": 20, "offset": 1091 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 21, "column": 1, "offset": 931 }, "end": { "line": 23, "column": 20, "offset": 1091 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If a call to this method exceeds 5 seconds without returning, and no\n", "position": { "start": { "line": 24, "column": 3, "offset": 1094 }, "end": { "line": 25, "column": 1, "offset": 1163 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "timeOut" } ], "position": { "start": { "line": 25, "column": 3, "offset": 1165 }, "end": { "line": 25, "column": 12, "offset": 1174 } } }, { "type": "text", "value": " parameter has been specified, a warning will be printed to the\noutput that the thread may yield indefinitely. This warning takes the\nfollowing form where ", "position": { "start": { "line": 25, "column": 12, "offset": 1174 }, "end": { "line": 27, "column": 24, "offset": 1333 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "X" } ], "position": { "start": { "line": 27, "column": 24, "offset": 1333 }, "end": { "line": 27, "column": 27, "offset": 1336 } } }, { "type": "text", "value": " is the parent's name and ", "position": { "start": { "line": 27, "column": 27, "offset": 1336 }, "end": { "line": 27, "column": 53, "offset": 1362 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Y" } ], "position": { "start": { "line": 27, "column": 53, "offset": 1362 }, "end": { "line": 27, "column": 56, "offset": 1365 } } }, { "type": "text", "value": " is the child's\nname:", "position": { "start": { "line": 27, "column": 56, "offset": 1365 }, "end": { "line": 28, "column": 8, "offset": 1388 } } } ], "position": { "start": { "line": 24, "column": 3, "offset": 1094 }, "end": { "line": 28, "column": 8, "offset": 1388 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Infinite yield possible on 'X:WaitForChild(\"Y\")'" } ], "position": { "start": { "line": 30, "column": 3, "offset": 1392 }, "end": { "line": 30, "column": 53, "offset": 1442 } } } ], "position": { "start": { "line": 30, "column": 3, "offset": 1392 }, "end": { "line": 30, "column": 53, "offset": 1442 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 24, "column": 1, "offset": 1092 }, "end": { "line": 30, "column": 53, "offset": 1442 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 19, "column": 1, "offset": 837 }, "end": { "line": 30, "column": 53, "offset": 1442 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-WaitForChild1", "displayName": "Instance:WaitForChild", "description": "The following code waits for an instance named \"Part\" to be added to\nWorkspace.\n", "codeSample": "local part = workspace:WaitForChild(\"Part\")\nprint(part.Name .. \" has been added to the Workspace\")", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "childName", "type": "string", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Name" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 26, "offset": 25 } } }, { "type": "text", "value": " to be looked for.", "position": { "start": { "line": 1, "column": 26, "offset": 25 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } }, { "name": "timeOut", "type": "double", "default": "null", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "An optional time out parameter.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 32, "offset": 31 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "returns": [ { "type": "Instance", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " found.", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 28, "offset": 27 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [ "CUSTOM_LUA_STATE", "CAN_YIELD" ], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:children", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Returns an array of the object's children.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 43, "offset": 42 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 43, "offset": 42 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The children function returns an array of the object's children.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 65, "offset": 64 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 65, "offset": 64 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [], "returns": [ { "type": "Objects", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Array of child objects/instances.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 34, "offset": 33 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 34, "offset": 33 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This item has been superseded by ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 34, "offset": 33 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetChildren()" } ], "position": { "start": { "line": 1, "column": 34, "offset": 33 }, "end": { "line": 1, "column": 64, "offset": 63 } } }, { "type": "text", "value": " which\nshould be used in all new work.", "position": { "start": { "line": 1, "column": 64, "offset": 63 }, "end": { "line": 2, "column": 32, "offset": 101 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 32, "offset": 101 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:clone", "summary": "", "description": "", "codeSamples": null, "parameters": [], "returns": [ { "type": "Instance", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated function is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Clone()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 66, "offset": 65 } } }, { "type": "text", "value": " which\nshould be used instead.", "position": { "start": { "line": 1, "column": 66, "offset": 65 }, "end": { "line": 2, "column": 24, "offset": 95 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 24, "offset": 95 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:destroy", "summary": "", "description": "", "codeSamples": null, "parameters": [], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated function is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Destroy()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 68, "offset": 67 } } }, { "type": "text", "value": " which\nshould be used instead.", "position": { "start": { "line": 1, "column": 68, "offset": 67 }, "end": { "line": 2, "column": 24, "offset": 97 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 24, "offset": 97 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:findFirstChild", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "name", "type": "string", "default": "null", "summary": "" }, { "name": "recursive", "type": "bool", "default": "false", "summary": "" } ], "returns": [ { "type": "Instance", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated function is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:FindFirstChild()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 75, "offset": 74 } } }, { "type": "text", "value": "\nwhich should be used instead.", "position": { "start": { "line": 1, "column": 75, "offset": 74 }, "end": { "line": 2, "column": 30, "offset": 104 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 30, "offset": 104 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:getChildren", "summary": "", "description": "", "codeSamples": null, "parameters": [], "returns": [ { "type": "Objects", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated function is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetChildren()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 72, "offset": 71 } } }, { "type": "text", "value": "\nwhich should be used instead.", "position": { "start": { "line": 1, "column": 72, "offset": 71 }, "end": { "line": 2, "column": 30, "offset": 101 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 30, "offset": 101 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:isA", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "className", "type": "string", "default": "null", "summary": "" } ], "returns": [ { "type": "bool", "summary": "" } ], "tags": [ "DEPRECATED", "CUSTOM_LUA_STATE" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated function is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsA()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 64, "offset": 63 } } }, { "type": "text", "value": " which\nshould be used instead.", "position": { "start": { "line": 1, "column": 64, "offset": 63 }, "end": { "line": 2, "column": 24, "offset": 93 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 24, "offset": 93 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:isDescendantOf", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "ancestor", "type": "Instance", "default": "null", "summary": "" } ], "returns": [ { "type": "bool", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated function is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:IsDescendantOf()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 75, "offset": 74 } } }, { "type": "text", "value": "\nwhich should be used instead.", "position": { "start": { "line": 1, "column": 75, "offset": 74 }, "end": { "line": 2, "column": 30, "offset": 104 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 30, "offset": 104 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" }, { "name": "Instance:remove", "summary": "", "description": "", "codeSamples": null, "parameters": [], "returns": [ { "type": "void", "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated function is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Remove()" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 67, "offset": 66 } } }, { "type": "text", "value": " which\nhas also been deprecated. Neither function should be used in new work.", "position": { "start": { "line": 1, "column": 67, "offset": 66 }, "end": { "line": 2, "column": 71, "offset": 143 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 71, "offset": 143 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Method" } ], "events": [ { "name": "Instance.AncestryChanged", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fires when the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 16, "offset": 15 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 1, "column": 16, "offset": 15 }, "end": { "line": 1, "column": 39, "offset": 38 } } }, { "type": "text", "value": " property of the object or one of\nits ancestors is changed.", "position": { "start": { "line": 1, "column": 39, "offset": 38 }, "end": { "line": 2, "column": 26, "offset": 97 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 26, "offset": 97 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fires when the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 16, "offset": 15 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 1, "column": 16, "offset": 15 }, "end": { "line": 1, "column": 39, "offset": 38 } } }, { "type": "text", "value": " property of the object or one of\nits ancestors is changed.", "position": { "start": { "line": 1, "column": 39, "offset": 38 }, "end": { "line": 2, "column": 26, "offset": 97 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 26, "offset": 97 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This event includes two parameters, ", "position": { "start": { "line": 4, "column": 1, "offset": 99 }, "end": { "line": 4, "column": 37, "offset": 135 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "child", "position": { "start": { "line": 4, "column": 38, "offset": 136 }, "end": { "line": 4, "column": 43, "offset": 141 } } } ], "position": { "start": { "line": 4, "column": 37, "offset": 135 }, "end": { "line": 4, "column": 44, "offset": 142 } } }, { "type": "text", "value": " and ", "position": { "start": { "line": 4, "column": 44, "offset": 142 }, "end": { "line": 4, "column": 49, "offset": 147 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "parent", "position": { "start": { "line": 4, "column": 50, "offset": 148 }, "end": { "line": 4, "column": 56, "offset": 154 } } } ], "position": { "start": { "line": 4, "column": 49, "offset": 147 }, "end": { "line": 4, "column": 57, "offset": 155 } } }, { "type": "text", "value": ". ", "position": { "start": { "line": 4, "column": 57, "offset": 155 }, "end": { "line": 4, "column": 59, "offset": 157 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "Child", "position": { "start": { "line": 4, "column": 60, "offset": 158 }, "end": { "line": 4, "column": 65, "offset": 163 } } } ], "position": { "start": { "line": 4, "column": 59, "offset": 157 }, "end": { "line": 4, "column": 66, "offset": 164 } } }, { "type": "text", "value": " refers\nto the ", "position": { "start": { "line": 4, "column": 66, "offset": 164 }, "end": { "line": 5, "column": 8, "offset": 179 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 5, "column": 8, "offset": 179 }, "end": { "line": 5, "column": 24, "offset": 195 } } }, { "type": "text", "value": " whose ", "position": { "start": { "line": 5, "column": 24, "offset": 195 }, "end": { "line": 5, "column": 31, "offset": 202 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 5, "column": 31, "offset": 202 }, "end": { "line": 5, "column": 54, "offset": 225 } } }, { "type": "text", "value": " was actually\nchanged. ", "position": { "start": { "line": 5, "column": 54, "offset": 225 }, "end": { "line": 6, "column": 10, "offset": 248 } } }, { "type": "element", "tagName": "em", "properties": {}, "children": [ { "type": "text", "value": "Parent", "position": { "start": { "line": 6, "column": 11, "offset": 249 }, "end": { "line": 6, "column": 17, "offset": 255 } } } ], "position": { "start": { "line": 6, "column": 10, "offset": 248 }, "end": { "line": 6, "column": 18, "offset": 256 } } }, { "type": "text", "value": " refers to this ", "position": { "start": { "line": 6, "column": 18, "offset": 256 }, "end": { "line": 6, "column": 34, "offset": 272 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 6, "column": 34, "offset": 272 }, "end": { "line": 6, "column": 50, "offset": 288 } } }, { "type": "text", "value": "'s new\n", "position": { "start": { "line": 6, "column": 50, "offset": 288 }, "end": { "line": 7, "column": 1, "offset": 295 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 7, "column": 1, "offset": 295 }, "end": { "line": 7, "column": 24, "offset": 318 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 7, "column": 24, "offset": 318 }, "end": { "line": 7, "column": 25, "offset": 319 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 99 }, "end": { "line": 7, "column": 25, "offset": 319 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "You can use this event to track the deletion of an instance in Studio,\nsuch as manual deletion in the Explorer or through a plugin. If you need\nto detect when an instance is destroyed using ", "position": { "start": { "line": 9, "column": 1, "offset": 321 }, "end": { "line": 11, "column": 47, "offset": 511 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Destroy()" } ], "position": { "start": { "line": 11, "column": 47, "offset": 511 }, "end": { "line": 11, "column": 73, "offset": 537 } } }, { "type": "text", "value": ",\nuse the ", "position": { "start": { "line": 11, "column": 73, "offset": 537 }, "end": { "line": 12, "column": 9, "offset": 547 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Destroying" } ], "position": { "start": { "line": 12, "column": 9, "offset": 547 }, "end": { "line": 12, "column": 36, "offset": 574 } } }, { "type": "text", "value": " event instead.", "position": { "start": { "line": 12, "column": 36, "offset": 574 }, "end": { "line": 12, "column": 51, "offset": 589 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 321 }, "end": { "line": 12, "column": 51, "offset": 589 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-AncestryChanged1", "displayName": "Instance.AncestryChanged", "description": "The below example would print \"Part is now a child of Model\".\n", "codeSample": "local part = Instance.new(\"Part\")\npart.Parent = workspace\n\nlocal function onAncestryChanged(child, parent)\n\tprint(child.Name .. \" is now a child of \" .. parent.Name)\nend\n\npart.AncestryChanged:Connect(onAncestryChanged)\n\npart.Parent = workspace.Model", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "child", "type": "Instance", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " whose ", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 28, "offset": 27 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 1, "column": 28, "offset": 27 }, "end": { "line": 1, "column": 51, "offset": 50 } } }, { "type": "text", "value": " has been changed.", "position": { "start": { "line": 1, "column": 51, "offset": 50 }, "end": { "line": 1, "column": 69, "offset": 68 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 69, "offset": 68 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } }, { "name": "parent", "type": "Instance", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The new ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 9, "offset": 8 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 1, "column": 9, "offset": 8 }, "end": { "line": 1, "column": 32, "offset": 31 } } }, { "type": "text", "value": " of the ", "position": { "start": { "line": 1, "column": 32, "offset": 31 }, "end": { "line": 1, "column": 40, "offset": 39 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 40, "offset": 39 }, "end": { "line": 1, "column": 56, "offset": 55 } } }, { "type": "text", "value": " whose\n", "position": { "start": { "line": 1, "column": 56, "offset": 55 }, "end": { "line": 2, "column": 1, "offset": 62 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent" } ], "position": { "start": { "line": 2, "column": 1, "offset": 62 }, "end": { "line": 2, "column": 24, "offset": 85 } } }, { "type": "text", "value": " was changed.", "position": { "start": { "line": 2, "column": 24, "offset": 85 }, "end": { "line": 2, "column": 37, "offset": 98 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 37, "offset": 98 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Instance.AttributeChanged", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fires whenever an attribute is changed on the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 47, "offset": 46 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 47, "offset": 46 }, "end": { "line": 1, "column": 63, "offset": 62 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 63, "offset": 62 }, "end": { "line": 1, "column": 64, "offset": 63 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 64, "offset": 63 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This event fires whenever an attribute is changed on the instance. This\nincludes when an attribute is set to nil. The name of the attribute that\nhas been changed is passed to the connected function.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 54, "offset": 198 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 54, "offset": 198 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "For example, the following code snippet will connect the\n", "position": { "start": { "line": 5, "column": 1, "offset": 200 }, "end": { "line": 6, "column": 1, "offset": 257 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "AttributeChanged" } ], "position": { "start": { "line": 6, "column": 1, "offset": 257 }, "end": { "line": 6, "column": 19, "offset": 275 } } }, { "type": "text", "value": " function to fire whenever one of ", "position": { "start": { "line": 6, "column": 19, "offset": 275 }, "end": { "line": 6, "column": 53, "offset": 309 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 6, "column": 53, "offset": 309 }, "end": { "line": 6, "column": 69, "offset": 325 } } }, { "type": "text", "value": "'s\nattributes changes. Note that this code sample does not define\n", "position": { "start": { "line": 6, "column": 69, "offset": 325 }, "end": { "line": 8, "column": 1, "offset": 391 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 8, "column": 1, "offset": 391 }, "end": { "line": 8, "column": 17, "offset": 407 } } }, { "type": "text", "value": ":", "position": { "start": { "line": 8, "column": 17, "offset": 407 }, "end": { "line": 8, "column": 18, "offset": 408 } } } ], "position": { "start": { "line": 5, "column": 1, "offset": 200 }, "end": { "line": 8, "column": 18, "offset": 408 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "local function attributeChanged(attributeName)\n print(attributeName, \"changed\")\nend\n\ninstance.AttributeChanged:Connect(attributeChanged)\n" } ], "position": { "start": { "line": 10, "column": 1, "offset": 410 }, "end": { "line": 16, "column": 4, "offset": 560 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 410 }, "end": { "line": 16, "column": 4, "offset": 560 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also:", "position": { "start": { "line": 18, "column": 1, "offset": 562 }, "end": { "line": 18, "column": 10, "offset": 571 } } } ], "position": { "start": { "line": 18, "column": 1, "offset": 562 }, "end": { "line": 18, "column": 10, "offset": 571 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:SetAttribute()" } ], "position": { "start": { "line": 20, "column": 3, "offset": 575 }, "end": { "line": 20, "column": 34, "offset": 606 } } }, { "type": "text", "value": ", sets the attribute with the given name\nto the given value", "position": { "start": { "line": 20, "column": 34, "offset": 606 }, "end": { "line": 21, "column": 21, "offset": 667 } } } ], "position": { "start": { "line": 20, "column": 1, "offset": 573 }, "end": { "line": 21, "column": 21, "offset": 667 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetAttribute()" } ], "position": { "start": { "line": 22, "column": 3, "offset": 670 }, "end": { "line": 22, "column": 34, "offset": 701 } } }, { "type": "text", "value": ", returns the attribute which has been\nassigned to the given name", "position": { "start": { "line": 22, "column": 34, "offset": 701 }, "end": { "line": 23, "column": 29, "offset": 768 } } } ], "position": { "start": { "line": 22, "column": 1, "offset": 668 }, "end": { "line": 23, "column": 29, "offset": 768 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetAttributes()" } ], "position": { "start": { "line": 24, "column": 3, "offset": 771 }, "end": { "line": 24, "column": 35, "offset": 803 } } }, { "type": "text", "value": ", returns a dictionary of string →\nvariant pairs for each of the instance's attributes", "position": { "start": { "line": 24, "column": 35, "offset": 803 }, "end": { "line": 25, "column": 54, "offset": 891 } } } ], "position": { "start": { "line": 24, "column": 1, "offset": 769 }, "end": { "line": 25, "column": 54, "offset": 891 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:GetAttributeChangedSignal()" } ], "position": { "start": { "line": 26, "column": 3, "offset": 894 }, "end": { "line": 26, "column": 47, "offset": 938 } } }, { "type": "text", "value": ", returns an event that\nfires when the given attribute changes", "position": { "start": { "line": 26, "column": 47, "offset": 938 }, "end": { "line": 27, "column": 41, "offset": 1002 } } } ], "position": { "start": { "line": 26, "column": 1, "offset": 892 }, "end": { "line": 27, "column": 41, "offset": 1002 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 20, "column": 1, "offset": 573 }, "end": { "line": 27, "column": 41, "offset": 1002 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": null, "parameters": [ { "name": "attribute", "type": "string", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The name of the attribute that has been changed.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 49, "offset": 48 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Instance.Changed", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fired immediately after a property of an object changes.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 57, "offset": 56 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 57, "offset": 56 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The Changed event fires right after most properties change on objects. It\nis possible to find the present value of a changed property by using\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 3, "column": 1, "offset": 143 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "object[property]" } ], "position": { "start": { "line": 3, "column": 1, "offset": 143 }, "end": { "line": 3, "column": 19, "offset": 161 } } }, { "type": "text", "value": ". To get the value of a property before it changes, you\nmust have stored the value of the property before it changed.", "position": { "start": { "line": 3, "column": 19, "offset": 161 }, "end": { "line": 4, "column": 62, "offset": 278 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 4, "column": 62, "offset": 278 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If you are only interested in listening to the change of a specific\nproperty, consider using the ", "position": { "start": { "line": 6, "column": 1, "offset": 280 }, "end": { "line": 7, "column": 30, "offset": 377 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "GetPropertyChangedSignal" } ], "position": { "start": { "line": 7, "column": 30, "offset": 377 }, "end": { "line": 7, "column": 56, "offset": 403 } } }, { "type": "text", "value": " method instead to\nget an event that only fires when a given property changes.", "position": { "start": { "line": 7, "column": 56, "offset": 403 }, "end": { "line": 8, "column": 60, "offset": 481 } } } ], "position": { "start": { "line": 6, "column": 1, "offset": 280 }, "end": { "line": 8, "column": 60, "offset": 481 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This event does not fire for physics-related changes, like when the\n", "position": { "start": { "line": 10, "column": 1, "offset": 483 }, "end": { "line": 11, "column": 1, "offset": 551 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Datatype.CFrame" } ], "position": { "start": { "line": 11, "column": 1, "offset": 551 }, "end": { "line": 11, "column": 18, "offset": 568 } } }, { "type": "text", "value": ", ", "position": { "start": { "line": 11, "column": 18, "offset": 568 }, "end": { "line": 11, "column": 20, "offset": 570 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Velocity" } ], "position": { "start": { "line": 11, "column": 20, "offset": 570 }, "end": { "line": 11, "column": 30, "offset": 580 } } }, { "type": "text", "value": ", ", "position": { "start": { "line": 11, "column": 30, "offset": 580 }, "end": { "line": 11, "column": 32, "offset": 582 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "RotVelocity" } ], "position": { "start": { "line": 11, "column": 32, "offset": 582 }, "end": { "line": 11, "column": 45, "offset": 595 } } }, { "type": "text", "value": ", ", "position": { "start": { "line": 11, "column": 45, "offset": 595 }, "end": { "line": 11, "column": 47, "offset": 597 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Position" } ], "position": { "start": { "line": 11, "column": 47, "offset": 597 }, "end": { "line": 11, "column": 57, "offset": 607 } } }, { "type": "text", "value": ", ", "position": { "start": { "line": 11, "column": 57, "offset": 607 }, "end": { "line": 11, "column": 59, "offset": 609 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Orientation" } ], "position": { "start": { "line": 11, "column": 59, "offset": 609 }, "end": { "line": 11, "column": 72, "offset": 622 } } }, { "type": "text", "value": "\nand ", "position": { "start": { "line": 11, "column": 72, "offset": 622 }, "end": { "line": 12, "column": 5, "offset": 627 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Datatype.CFrame" } ], "position": { "start": { "line": 12, "column": 5, "offset": 627 }, "end": { "line": 12, "column": 22, "offset": 644 } } }, { "type": "text", "value": " properties of a ", "position": { "start": { "line": 12, "column": 22, "offset": 644 }, "end": { "line": 12, "column": 39, "offset": 661 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.BasePart" } ], "position": { "start": { "line": 12, "column": 39, "offset": 661 }, "end": { "line": 12, "column": 55, "offset": 677 } } }, { "type": "text", "value": " change due to\ngravity. To detect changes in these properties, consider using a\nphysics-based event like ", "position": { "start": { "line": 12, "column": 55, "offset": 677 }, "end": { "line": 14, "column": 26, "offset": 782 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.RunService.Stepped" } ], "position": { "start": { "line": 14, "column": 26, "offset": 782 }, "end": { "line": 14, "column": 52, "offset": 808 } } }, { "type": "text", "value": " or\n", "position": { "start": { "line": 14, "column": 52, "offset": 808 }, "end": { "line": 15, "column": 1, "offset": 812 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.BasePart.Touched" } ], "position": { "start": { "line": 15, "column": 1, "offset": 812 }, "end": { "line": 15, "column": 25, "offset": 836 } } }, { "type": "text", "value": ". A while-true-do loop can also work.", "position": { "start": { "line": 15, "column": 25, "offset": 836 }, "end": { "line": 15, "column": 62, "offset": 873 } } } ], "position": { "start": { "line": 10, "column": 1, "offset": 483 }, "end": { "line": 15, "column": 62, "offset": 873 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "For \"-Value\" objects, this event behaves differently: it only fires when\nthe ", "position": { "start": { "line": 17, "column": 1, "offset": 875 }, "end": { "line": 18, "column": 5, "offset": 952 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Value" } ], "position": { "start": { "line": 18, "column": 5, "offset": 952 }, "end": { "line": 18, "column": 12, "offset": 959 } } }, { "type": "text", "value": " property changes. See individual pages for ", "position": { "start": { "line": 18, "column": 12, "offset": 959 }, "end": { "line": 18, "column": 56, "offset": 1003 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.IntValue" } ], "position": { "start": { "line": 18, "column": 56, "offset": 1003 }, "end": { "line": 18, "column": 72, "offset": 1019 } } }, { "type": "text", "value": ",\n", "position": { "start": { "line": 18, "column": 72, "offset": 1019 }, "end": { "line": 19, "column": 1, "offset": 1021 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.StringValue" } ], "position": { "start": { "line": 19, "column": 1, "offset": 1021 }, "end": { "line": 19, "column": 20, "offset": 1040 } } }, { "type": "text", "value": ", etc for more information. To detect other changes in\nthese objects, you must use ", "position": { "start": { "line": 19, "column": 20, "offset": 1040 }, "end": { "line": 20, "column": 29, "offset": 1123 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "GetPropertyChangedSignal" } ], "position": { "start": { "line": 20, "column": 29, "offset": 1123 }, "end": { "line": 20, "column": 55, "offset": 1149 } } }, { "type": "text", "value": " instead.", "position": { "start": { "line": 20, "column": 55, "offset": 1149 }, "end": { "line": 20, "column": 64, "offset": 1158 } } } ], "position": { "start": { "line": 17, "column": 1, "offset": 875 }, "end": { "line": 20, "column": 64, "offset": 1158 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Changed-Event", "displayName": "Changed Event", "description": "This sample demonstrates the subtleties of the Changed event on normal objects\nand \"-Value\" objects.\n", "codeSample": "-- Demonstrate the Changed event by creating a Part\nlocal part = Instance.new(\"Part\")\npart.Changed:Connect(print)\n-- This fires Changed with \"Transparency\"\npart.Transparency = 0.5\n-- Similarly, this fires Changed with \"Number\"\npart.Name = \"SomePart\"\n-- Since changing BrickColor will also change other\n-- properties at the same time, this line fires Changed\n-- with \"BrickColor\", \"Color3\" and \"Color3uint16\".\npart.BrickColor = BrickColor.Red()\n\n-- A NumberValue holds a double-precision floating-point number\nlocal vNumber = Instance.new(\"NumberValue\")\nvNumber.Changed:Connect(print)\n-- This fires Changed with 123.456 (not \"Value\")\nvNumber.Value = 123.456\n-- This does not fire Changed\nvNumber.Name = \"SomeNumber\"\n\n-- A StringValue stores one string\nlocal vString = Instance.new(\"StringValue\")\nvString.Changed:Connect(print)\n-- This fires Changed with \"Hello\" (not \"Value\")\nvString.Value = \"Hello\"", "expectedOutput": "", "highlightLines": "" }, { "identifier": "Change-Detector", "displayName": "Change Detector", "description": "This code sample demonstrates the Changed event firing within a parent object.\n", "codeSample": "local object = script.Parent\n\nlocal function onChanged(property)\n\t-- Get the current value of the property\n\tlocal value = object[property]\n\t-- Print a message saying what changed\n\tprint(object:GetFullName() .. \".\" .. property .. \" (\" .. typeof(value) .. \") changed to \" .. tostring(value))\nend\n\nobject.Changed:Connect(onChanged)\n-- Trigger a simple change in the object (add an underscore to the name)\nobject.Name = \"_\" .. object.Name", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "property", "type": "string", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The name of the property that changed.", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 39, "offset": 38 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 39, "offset": 38 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Instance.ChildAdded", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fires after an object is parented to this ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 43, "offset": 42 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 43, "offset": 42 }, "end": { "line": 1, "column": 59, "offset": 58 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 59, "offset": 58 }, "end": { "line": 1, "column": 60, "offset": 59 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 60, "offset": 59 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fires after an object is parented to this ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 43, "offset": 42 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 43, "offset": 42 }, "end": { "line": 1, "column": 59, "offset": 58 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 59, "offset": 58 }, "end": { "line": 1, "column": 60, "offset": 59 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 60, "offset": 59 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note, when using this function on a client to detect objects created by\nthe server it is necessary to use ", "position": { "start": { "line": 3, "column": 1, "offset": 61 }, "end": { "line": 4, "column": 35, "offset": 167 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:WaitForChild()" } ], "position": { "start": { "line": 4, "column": 35, "offset": 167 }, "end": { "line": 4, "column": 66, "offset": 198 } } }, { "type": "text", "value": " when\nindexing these object's descendants. This is because the object and its\ndescendants are not guaranteed to replicate from the server to the client\nsimultaneously. For example:", "position": { "start": { "line": 4, "column": 66, "offset": 198 }, "end": { "line": 7, "column": 29, "offset": 378 } } } ], "position": { "start": { "line": 3, "column": 1, "offset": 61 }, "end": { "line": 7, "column": 29, "offset": 378 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "workspace.ChildAdded:Connect(function(child)\n\t-- need to use WaitForChild as descendants may not have replicated yet\n\tlocal head = child:WaitForChild(\"Head\")\nend)\n" } ], "position": { "start": { "line": 9, "column": 1, "offset": 380 }, "end": { "line": 14, "column": 4, "offset": 550 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 380 }, "end": { "line": 14, "column": 4, "offset": 550 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Note, this function only works for immediate children of the\n", "position": { "start": { "line": 16, "column": 1, "offset": 552 }, "end": { "line": 17, "column": 1, "offset": 613 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 17, "column": 1, "offset": 613 }, "end": { "line": 17, "column": 17, "offset": 629 } } }, { "type": "text", "value": ". For a function that captures all descendants, use\n", "position": { "start": { "line": 17, "column": 17, "offset": 629 }, "end": { "line": 18, "column": 1, "offset": 681 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.DescendantAdded" } ], "position": { "start": { "line": 18, "column": 1, "offset": 681 }, "end": { "line": 18, "column": 33, "offset": 713 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 18, "column": 33, "offset": 713 }, "end": { "line": 18, "column": 34, "offset": 714 } } } ], "position": { "start": { "line": 16, "column": 1, "offset": 552 }, "end": { "line": 18, "column": 34, "offset": 714 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also, ", "position": { "start": { "line": 20, "column": 1, "offset": 716 }, "end": { "line": 20, "column": 11, "offset": 726 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ChildRemoved" } ], "position": { "start": { "line": 20, "column": 11, "offset": 726 }, "end": { "line": 20, "column": 40, "offset": 755 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 20, "column": 40, "offset": 755 }, "end": { "line": 20, "column": 41, "offset": 756 } } } ], "position": { "start": { "line": 20, "column": 1, "offset": 716 }, "end": { "line": 20, "column": 41, "offset": 756 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-ChildAdded1", "displayName": "Instance.ChildAdded", "description": "This snippet prints the names of objects as they are added to the Workspace:\n", "codeSample": "local function onChildAdded(instance)\n\tprint(instance.Name .. \" added to the workspace\")\nend\n\nworkspace.ChildAdded:Connect(onChildAdded)\n\nlocal part = Instance.new(\"Part\")\npart.Parent = workspace --> Part added to the Workspace", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "child", "type": "Instance", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " that has been added.", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 42, "offset": 41 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Instance.ChildRemoved", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fires after a child is removed from this ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 58, "offset": 57 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 58, "offset": 57 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fires after a child is removed from this ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 58, "offset": 57 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 58, "offset": 57 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Removed refers to when an object's parent is changed from this\n", "position": { "start": { "line": 3, "column": 1, "offset": 60 }, "end": { "line": 4, "column": 1, "offset": 123 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 4, "column": 1, "offset": 123 }, "end": { "line": 4, "column": 17, "offset": 139 } } }, { "type": "text", "value": " to something other than this ", "position": { "start": { "line": 4, "column": 17, "offset": 139 }, "end": { "line": 4, "column": 47, "offset": 169 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 4, "column": 47, "offset": 169 }, "end": { "line": 4, "column": 63, "offset": 185 } } }, { "type": "text", "value": ". Note, this\nevent will also fire when a child is destroyed (using\n", "position": { "start": { "line": 4, "column": 63, "offset": 185 }, "end": { "line": 6, "column": 1, "offset": 252 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Destroy()" } ], "position": { "start": { "line": 6, "column": 1, "offset": 252 }, "end": { "line": 6, "column": 27, "offset": 278 } } }, { "type": "text", "value": ") as the destroy function sets an object's\nparent to nil.", "position": { "start": { "line": 6, "column": 27, "offset": 278 }, "end": { "line": 7, "column": 15, "offset": 335 } } } ], "position": { "start": { "line": 3, "column": 1, "offset": 60 }, "end": { "line": 7, "column": 15, "offset": 335 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This function only works for immediate children of the ", "position": { "start": { "line": 9, "column": 1, "offset": 337 }, "end": { "line": 9, "column": 56, "offset": 392 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 9, "column": 56, "offset": 392 }, "end": { "line": 9, "column": 72, "offset": 408 } } }, { "type": "text", "value": ".\nFor a function that captures all descendants, use\n", "position": { "start": { "line": 9, "column": 72, "offset": 408 }, "end": { "line": 11, "column": 1, "offset": 460 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.DescendantRemoving" } ], "position": { "start": { "line": 11, "column": 1, "offset": 460 }, "end": { "line": 11, "column": 36, "offset": 495 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 11, "column": 36, "offset": 495 }, "end": { "line": 11, "column": 37, "offset": 496 } } } ], "position": { "start": { "line": 9, "column": 1, "offset": 337 }, "end": { "line": 11, "column": 37, "offset": 496 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also ", "position": { "start": { "line": 13, "column": 1, "offset": 498 }, "end": { "line": 13, "column": 10, "offset": 507 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ChildAdded" } ], "position": { "start": { "line": 13, "column": 10, "offset": 507 }, "end": { "line": 13, "column": 37, "offset": 534 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 13, "column": 37, "offset": 534 }, "end": { "line": 13, "column": 38, "offset": 535 } } } ], "position": { "start": { "line": 13, "column": 1, "offset": 498 }, "end": { "line": 13, "column": 38, "offset": 535 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-ChildRemoved1", "displayName": "Instance.ChildRemoved", "description": "This snippet prints the names of objects as they are removed from the\nWorkspace:\n", "codeSample": "local function onChildRemoved(instance)\n\tprint(instance.Name .. \" removed from the workspace\")\nend\n\nworkspace.ChildRemoved:Connect(onChildRemoved)\n\nlocal part = Instance.new(\"Part\")\npart.Parent = workspace\n\ntask.wait(2)\n\npart:Destroy()", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "child", "type": "Instance", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " that has been removed.", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Instance.DescendantAdded", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fires after a descendant is added to the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 42, "offset": 41 }, "end": { "line": 1, "column": 58, "offset": 57 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 1, "column": 58, "offset": 57 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 59, "offset": 58 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The DescendantAdded event fires after a descendant is added to the\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 67 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 2, "column": 1, "offset": 67 }, "end": { "line": 2, "column": 17, "offset": 83 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 2, "column": 17, "offset": 83 }, "end": { "line": 2, "column": 18, "offset": 84 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 18, "offset": 84 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "As DescendantAdded fires for every descendant, parenting an object to the\n", "position": { "start": { "line": 4, "column": 1, "offset": 86 }, "end": { "line": 5, "column": 1, "offset": 160 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 5, "column": 1, "offset": 160 }, "end": { "line": 5, "column": 17, "offset": 176 } } }, { "type": "text", "value": " will fire the event for this object and all of its\ndescendants individually.", "position": { "start": { "line": 5, "column": 17, "offset": 176 }, "end": { "line": 6, "column": 26, "offset": 253 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 86 }, "end": { "line": 6, "column": 26, "offset": 253 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Developers only concerned with the immediate children of the\n", "position": { "start": { "line": 8, "column": 1, "offset": 255 }, "end": { "line": 9, "column": 1, "offset": 316 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 9, "column": 1, "offset": 316 }, "end": { "line": 9, "column": 17, "offset": 332 } } }, { "type": "text", "value": " should use ", "position": { "start": { "line": 9, "column": 17, "offset": 332 }, "end": { "line": 9, "column": 29, "offset": 344 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ChildAdded" } ], "position": { "start": { "line": 9, "column": 29, "offset": 344 }, "end": { "line": 9, "column": 56, "offset": 371 } } }, { "type": "text", "value": " instead.", "position": { "start": { "line": 9, "column": 56, "offset": 371 }, "end": { "line": 9, "column": 65, "offset": 380 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 255 }, "end": { "line": 9, "column": 65, "offset": 380 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also ", "position": { "start": { "line": 11, "column": 1, "offset": 382 }, "end": { "line": 11, "column": 10, "offset": 391 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.DescendantRemoving" } ], "position": { "start": { "line": 11, "column": 10, "offset": 391 }, "end": { "line": 11, "column": 45, "offset": 426 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 11, "column": 45, "offset": 426 }, "end": { "line": 11, "column": 46, "offset": 427 } } } ], "position": { "start": { "line": 11, "column": 1, "offset": 382 }, "end": { "line": 11, "column": 46, "offset": 427 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-DescendantAdded1", "displayName": "Instance.DescendantAdded", "description": "This following example will print the name of any object that is added to the\nWorkspace:\n", "codeSample": "local function onDescendantAdded(descendant)\n\tprint(descendant)\nend\n\nworkspace.DescendantAdded:Connect(onDescendantAdded)\n\nlocal part = Instance.new(\"Part\")\npart.Parent = workspace", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "descendant", "type": "Instance", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " that has been added.", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 42, "offset": 41 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 42, "offset": 41 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Instance.DescendantRemoving", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fires immediately before a descendant of the ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 46, "offset": 45 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 46, "offset": 45 }, "end": { "line": 1, "column": 62, "offset": 61 } } }, { "type": "text", "value": " is removed.", "position": { "start": { "line": 1, "column": 62, "offset": 61 }, "end": { "line": 1, "column": 74, "offset": 73 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 74, "offset": 73 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "DescendantRemoving fires ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 26, "offset": 25 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "immediately before", "position": { "start": { "line": 1, "column": 28, "offset": 27 }, "end": { "line": 1, "column": 46, "offset": 45 } } } ], "position": { "start": { "line": 1, "column": 26, "offset": 25 }, "end": { "line": 1, "column": 48, "offset": 47 } } }, { "type": "text", "value": " the\n", "position": { "start": { "line": 1, "column": 48, "offset": 47 }, "end": { "line": 2, "column": 1, "offset": 52 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent|Parent" } ], "position": { "start": { "line": 2, "column": 1, "offset": 52 }, "end": { "line": 2, "column": 31, "offset": 82 } } }, { "type": "text", "value": " of a descendant of the ", "position": { "start": { "line": 2, "column": 31, "offset": 82 }, "end": { "line": 2, "column": 55, "offset": 106 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 2, "column": 55, "offset": 106 }, "end": { "line": 2, "column": 71, "offset": 122 } } }, { "type": "text", "value": "\nchanges such that the object is no longer a descendant of the Instance.\n", "position": { "start": { "line": 2, "column": 71, "offset": 122 }, "end": { "line": 4, "column": 1, "offset": 195 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Destroy()|Destroy" } ], "position": { "start": { "line": 4, "column": 1, "offset": 195 }, "end": { "line": 4, "column": 35, "offset": 229 } } }, { "type": "text", "value": " and ", "position": { "start": { "line": 4, "column": 35, "offset": 229 }, "end": { "line": 4, "column": 40, "offset": 234 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Remove()|Remove" } ], "position": { "start": { "line": 4, "column": 40, "offset": 234 }, "end": { "line": 4, "column": 72, "offset": 266 } } }, { "type": "text", "value": "\nchange an object's Parent to nil, so calling these on a descendant of an\nobject will therefore cause this event to fire.", "position": { "start": { "line": 4, "column": 72, "offset": 266 }, "end": { "line": 6, "column": 48, "offset": 387 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 6, "column": 48, "offset": 387 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Since this event fires before the descendant's removal, the Parent of the\ndescendant will be unchanged, i.e., it will still be a descendant at the\ntime of this event firing. If the descendant is also a child of the\nobject, It will also fire before ChildRemoved. There is no similar event\ncalled \"DescendantRemoved\".", "position": { "start": { "line": 8, "column": 1, "offset": 389 }, "end": { "line": 12, "column": 28, "offset": 704 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 389 }, "end": { "line": 12, "column": 28, "offset": 704 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "If a descendant has children, this event fires with the descendant first\nfollowed by its descendants.", "position": { "start": { "line": 14, "column": 1, "offset": 706 }, "end": { "line": 15, "column": 29, "offset": 807 } } } ], "position": { "start": { "line": 14, "column": 1, "offset": 706 }, "end": { "line": 15, "column": 29, "offset": 807 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Example", "position": { "start": { "line": 17, "column": 6, "offset": 814 }, "end": { "line": 17, "column": 13, "offset": 821 } } } ], "position": { "start": { "line": 17, "column": 1, "offset": 809 }, "end": { "line": 17, "column": 13, "offset": 821 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The example below should help clarify how DescendantRemoving fires when\nthere are several objects involved.", "position": { "start": { "line": 19, "column": 1, "offset": 823 }, "end": { "line": 20, "column": 36, "offset": 930 } } } ], "position": { "start": { "line": 19, "column": 1, "offset": 823 }, "end": { "line": 20, "column": 36, "offset": 930 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "element", "tagName": "img", "properties": { "src": "/assets/legacy/DescendantRemoving2.png", "alt": "A cropped screenshot of the Explorer window. A Model contains ModelA and ModelB, which each contain a Part, PartA and PartB respectively. PartA contains a Fire object named FireA." }, "children": [], "position": { "start": { "line": 22, "column": 1, "offset": 932 }, "end": { "line": 22, "column": 223, "offset": 1154 } } } ], "position": { "start": { "line": 22, "column": 1, "offset": 932 }, "end": { "line": 22, "column": 223, "offset": 1154 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "ul", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Calling ", "position": { "start": { "line": 24, "column": 3, "offset": 1158 }, "end": { "line": 24, "column": 11, "offset": 1166 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Remove()|Remove" } ], "position": { "start": { "line": 24, "column": 11, "offset": 1166 }, "end": { "line": 24, "column": 43, "offset": 1198 } } }, { "type": "text", "value": " on ", "position": { "start": { "line": 24, "column": 43, "offset": 1198 }, "end": { "line": 24, "column": 47, "offset": 1202 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "PartA", "position": { "start": { "line": 24, "column": 49, "offset": 1204 }, "end": { "line": 24, "column": 54, "offset": 1209 } } } ], "position": { "start": { "line": 24, "column": 47, "offset": 1202 }, "end": { "line": 24, "column": 56, "offset": 1211 } } }, { "type": "text", "value": " would cause\nDescendantRemoving to fire on both ", "position": { "start": { "line": 24, "column": 56, "offset": 1211 }, "end": { "line": 25, "column": 38, "offset": 1261 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "ModelA", "position": { "start": { "line": 25, "column": 40, "offset": 1263 }, "end": { "line": 25, "column": 46, "offset": 1269 } } } ], "position": { "start": { "line": 25, "column": 38, "offset": 1261 }, "end": { "line": 25, "column": 48, "offset": 1271 } } }, { "type": "text", "value": " and ", "position": { "start": { "line": 25, "column": 48, "offset": 1271 }, "end": { "line": 25, "column": 53, "offset": 1276 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Model", "position": { "start": { "line": 25, "column": 55, "offset": 1278 }, "end": { "line": 25, "column": 60, "offset": 1283 } } } ], "position": { "start": { "line": 25, "column": 53, "offset": 1276 }, "end": { "line": 25, "column": 62, "offset": 1285 } } }, { "type": "text", "value": ", in that\norder.", "position": { "start": { "line": 25, "column": 62, "offset": 1285 }, "end": { "line": 26, "column": 9, "offset": 1303 } } } ], "position": { "start": { "line": 24, "column": 1, "offset": 1156 }, "end": { "line": 26, "column": 9, "offset": 1303 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Setting the ", "position": { "start": { "line": 27, "column": 3, "offset": 1306 }, "end": { "line": 27, "column": 15, "offset": 1318 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent|Parent" } ], "position": { "start": { "line": 27, "column": 15, "offset": 1318 }, "end": { "line": 27, "column": 45, "offset": 1348 } } }, { "type": "text", "value": " of ", "position": { "start": { "line": 27, "column": 45, "offset": 1348 }, "end": { "line": 27, "column": 49, "offset": 1352 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "PartA", "position": { "start": { "line": 27, "column": 51, "offset": 1354 }, "end": { "line": 27, "column": 56, "offset": 1359 } } } ], "position": { "start": { "line": 27, "column": 49, "offset": 1352 }, "end": { "line": 27, "column": 58, "offset": 1361 } } }, { "type": "text", "value": " to ", "position": { "start": { "line": 27, "column": 58, "offset": 1361 }, "end": { "line": 27, "column": 62, "offset": 1365 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "ModelB", "position": { "start": { "line": 27, "column": 64, "offset": 1367 }, "end": { "line": 27, "column": 70, "offset": 1373 } } } ], "position": { "start": { "line": 27, "column": 62, "offset": 1365 }, "end": { "line": 27, "column": 72, "offset": 1375 } } }, { "type": "text", "value": "\nwould cause DescendantRemoving to fire on ", "position": { "start": { "line": 27, "column": 72, "offset": 1375 }, "end": { "line": 28, "column": 45, "offset": 1420 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "ModelA", "position": { "start": { "line": 28, "column": 47, "offset": 1422 }, "end": { "line": 28, "column": 53, "offset": 1428 } } } ], "position": { "start": { "line": 28, "column": 45, "offset": 1420 }, "end": { "line": 28, "column": 55, "offset": 1430 } } }, { "type": "text", "value": " but not ", "position": { "start": { "line": 28, "column": 55, "offset": 1430 }, "end": { "line": 28, "column": 64, "offset": 1439 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Model", "position": { "start": { "line": 28, "column": 66, "offset": 1441 }, "end": { "line": 28, "column": 71, "offset": 1446 } } } ], "position": { "start": { "line": 28, "column": 64, "offset": 1439 }, "end": { "line": 28, "column": 73, "offset": 1448 } } }, { "type": "text", "value": "\n(as Model would still be an ancestor of PartA).", "position": { "start": { "line": 28, "column": 73, "offset": 1448 }, "end": { "line": 29, "column": 50, "offset": 1498 } } } ], "position": { "start": { "line": 27, "column": 1, "offset": 1304 }, "end": { "line": 29, "column": 50, "offset": 1498 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "Calling ", "position": { "start": { "line": 30, "column": 3, "offset": 1501 }, "end": { "line": 30, "column": 11, "offset": 1509 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Destroy()|Destroy" } ], "position": { "start": { "line": 30, "column": 11, "offset": 1509 }, "end": { "line": 30, "column": 45, "offset": 1543 } } }, { "type": "text", "value": " on ", "position": { "start": { "line": 30, "column": 45, "offset": 1543 }, "end": { "line": 30, "column": 49, "offset": 1547 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "ModelA", "position": { "start": { "line": 30, "column": 51, "offset": 1549 }, "end": { "line": 30, "column": 57, "offset": 1555 } } } ], "position": { "start": { "line": 30, "column": 49, "offset": 1547 }, "end": { "line": 30, "column": 59, "offset": 1557 } } }, { "type": "text", "value": " would cause\nDescendantRemoving to fire multiple times on several objects:\n", "position": { "start": { "line": 30, "column": 59, "offset": 1557 }, "end": null } }, { "type": "element", "tagName": "ol", "properties": {}, "children": [ { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "On ", "position": { "start": { "line": 32, "column": 6, "offset": 1639 }, "end": { "line": 32, "column": 9, "offset": 1642 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "Model", "position": { "start": { "line": 32, "column": 11, "offset": 1644 }, "end": { "line": 32, "column": 16, "offset": 1649 } } } ], "position": { "start": { "line": 32, "column": 9, "offset": 1642 }, "end": { "line": 32, "column": 18, "offset": 1651 } } }, { "type": "text", "value": " with ", "position": { "start": { "line": 32, "column": 18, "offset": 1651 }, "end": { "line": 32, "column": 24, "offset": 1657 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "ModelA", "position": { "start": { "line": 32, "column": 26, "offset": 1659 }, "end": { "line": 32, "column": 32, "offset": 1665 } } } ], "position": { "start": { "line": 32, "column": 24, "offset": 1657 }, "end": { "line": 32, "column": 34, "offset": 1667 } } }, { "type": "text", "value": ", ", "position": { "start": { "line": 32, "column": 34, "offset": 1667 }, "end": { "line": 32, "column": 36, "offset": 1669 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "PartA", "position": { "start": { "line": 32, "column": 38, "offset": 1671 }, "end": { "line": 32, "column": 43, "offset": 1676 } } } ], "position": { "start": { "line": 32, "column": 36, "offset": 1669 }, "end": { "line": 32, "column": 45, "offset": 1678 } } }, { "type": "text", "value": " then ", "position": { "start": { "line": 32, "column": 45, "offset": 1678 }, "end": { "line": 32, "column": 51, "offset": 1684 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "FireA", "position": { "start": { "line": 32, "column": 53, "offset": 1686 }, "end": { "line": 32, "column": 58, "offset": 1691 } } } ], "position": { "start": { "line": 32, "column": 51, "offset": 1684 }, "end": { "line": 32, "column": 60, "offset": 1693 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 32, "column": 60, "offset": 1693 }, "end": { "line": 32, "column": 61, "offset": 1694 } } } ], "position": { "start": { "line": 32, "column": 3, "offset": 1636 }, "end": { "line": 32, "column": 61, "offset": 1694 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "On ", "position": { "start": { "line": 33, "column": 6, "offset": 1700 }, "end": { "line": 33, "column": 9, "offset": 1703 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "ModelA", "position": { "start": { "line": 33, "column": 11, "offset": 1705 }, "end": { "line": 33, "column": 17, "offset": 1711 } } } ], "position": { "start": { "line": 33, "column": 9, "offset": 1703 }, "end": { "line": 33, "column": 19, "offset": 1713 } } }, { "type": "text", "value": ", with ", "position": { "start": { "line": 33, "column": 19, "offset": 1713 }, "end": { "line": 33, "column": 26, "offset": 1720 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "PartA", "position": { "start": { "line": 33, "column": 28, "offset": 1722 }, "end": { "line": 33, "column": 33, "offset": 1727 } } } ], "position": { "start": { "line": 33, "column": 26, "offset": 1720 }, "end": { "line": 33, "column": 35, "offset": 1729 } } }, { "type": "text", "value": " then ", "position": { "start": { "line": 33, "column": 35, "offset": 1729 }, "end": { "line": 33, "column": 41, "offset": 1735 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "FireA", "position": { "start": { "line": 33, "column": 43, "offset": 1737 }, "end": { "line": 33, "column": 48, "offset": 1742 } } } ], "position": { "start": { "line": 33, "column": 41, "offset": 1735 }, "end": { "line": 33, "column": 50, "offset": 1744 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 33, "column": 50, "offset": 1744 }, "end": { "line": 33, "column": 51, "offset": 1745 } } } ], "position": { "start": { "line": 33, "column": 3, "offset": 1697 }, "end": { "line": 33, "column": 51, "offset": 1745 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "li", "properties": {}, "children": [ { "type": "text", "value": "On ", "position": { "start": { "line": 34, "column": 6, "offset": 1751 }, "end": { "line": 34, "column": 9, "offset": 1754 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "PartA", "position": { "start": { "line": 34, "column": 11, "offset": 1756 }, "end": { "line": 34, "column": 16, "offset": 1761 } } } ], "position": { "start": { "line": 34, "column": 9, "offset": 1754 }, "end": { "line": 34, "column": 18, "offset": 1763 } } }, { "type": "text", "value": " with ", "position": { "start": { "line": 34, "column": 18, "offset": 1763 }, "end": { "line": 34, "column": 24, "offset": 1769 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "FireA", "position": { "start": { "line": 34, "column": 26, "offset": 1771 }, "end": { "line": 34, "column": 31, "offset": 1776 } } } ], "position": { "start": { "line": 34, "column": 24, "offset": 1769 }, "end": { "line": 34, "column": 33, "offset": 1778 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 34, "column": 33, "offset": 1778 }, "end": { "line": 34, "column": 34, "offset": 1779 } } } ], "position": { "start": { "line": 34, "column": 3, "offset": 1748 }, "end": { "line": 34, "column": 34, "offset": 1779 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 32, "column": 3, "offset": 1636 }, "end": { "line": 34, "column": 34, "offset": 1779 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 30, "column": 1, "offset": 1499 }, "end": { "line": 34, "column": 34, "offset": 1779 } } }, { "type": "text", "value": "\n" } ], "position": { "start": { "line": 24, "column": 1, "offset": 1156 }, "end": { "line": 34, "column": 34, "offset": 1779 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "h4", "properties": {}, "children": [ { "type": "text", "value": "Warning", "position": { "start": { "line": 36, "column": 6, "offset": 1786 }, "end": { "line": 36, "column": 13, "offset": 1793 } } } ], "position": { "start": { "line": 36, "column": 1, "offset": 1781 }, "end": { "line": 36, "column": 13, "offset": 1793 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This event fires with the descendant object that is being removed.\nAttempting to set the ", "position": { "start": { "line": 38, "column": 1, "offset": 1795 }, "end": { "line": 39, "column": 23, "offset": 1884 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.Parent|Parent" } ], "position": { "start": { "line": 39, "column": 23, "offset": 1884 }, "end": { "line": 39, "column": 53, "offset": 1914 } } }, { "type": "text", "value": " of the descendant\nbeing removed to something else ", "position": { "start": { "line": 39, "column": 53, "offset": 1914 }, "end": { "line": 40, "column": 33, "offset": 1965 } } }, { "type": "element", "tagName": "strong", "properties": {}, "children": [ { "type": "text", "value": "will fail", "position": { "start": { "line": 40, "column": 35, "offset": 1967 }, "end": { "line": 40, "column": 44, "offset": 1976 } } } ], "position": { "start": { "line": 40, "column": 33, "offset": 1965 }, "end": { "line": 40, "column": 46, "offset": 1978 } } }, { "type": "text", "value": " with the following warning:\n\"Something unexpectedly tried to set the parent of X to Y while trying to\nset the parent of X. Current parent is Z\", where X is the removing\ndescendant, Y is the ignored parent setting, and Z is the original parent\nof X. Below is an example that demonstrates this:", "position": { "start": { "line": 40, "column": 46, "offset": 1978 }, "end": { "line": 44, "column": 50, "offset": 2271 } } } ], "position": { "start": { "line": 38, "column": 1, "offset": 1795 }, "end": { "line": 44, "column": 50, "offset": 2271 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "pre", "properties": {}, "children": [ { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "workspace.DescendantRemoving:Connect(function(descendant)\n\t-- Don't manipulate the parent of descendant in this function!\n\t-- This event fires BECAUSE the parent of descendant was manipulated,\n\t-- and the change hasn't happened yet, i.e. this function fires before that happens.\n\t-- Therefore, it is problematic to change the parent like this:\n\tdescendant.Parent = game\nend)\nlocal part = Instance.new(\"Part\")\npart.Parent = workspace\npart.Parent = nil -- This triggers DescendantRemoving on Workspace:\n--> Something unexpectedly tried to set the parent of Part to NULL while trying to set the parent of Part. Current parent is Workspace.\n" } ], "position": { "start": { "line": 46, "column": 1, "offset": 2273 }, "end": { "line": 58, "column": 4, "offset": 2917 } } } ], "position": { "start": { "line": 46, "column": 1, "offset": 2273 }, "end": { "line": 58, "column": 4, "offset": 2917 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "See also ", "position": { "start": { "line": 60, "column": 1, "offset": 2919 }, "end": { "line": 60, "column": 10, "offset": 2928 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.DescendantAdded|DescendantAdded" } ], "position": { "start": { "line": 60, "column": 10, "offset": 2928 }, "end": { "line": 60, "column": 58, "offset": 2976 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 60, "column": 58, "offset": 2976 }, "end": { "line": 60, "column": 59, "offset": 2977 } } } ], "position": { "start": { "line": 60, "column": 1, "offset": 2919 }, "end": { "line": 60, "column": 59, "offset": 2977 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-DescendantRemoving1", "displayName": "Instance.DescendantRemoving", "description": "The following example prints the name of any descendant as it is being removed\nfrom the Workspace:\n", "codeSample": "workspace.DescendantRemoving:Connect(function(descendant)\n\tprint(descendant.Name .. \" is currently parented to \" .. tostring(descendant.Parent))\nend)\nlocal part = Instance.new(\"Part\")\npart.Parent = workspace\npart.Parent = nil\n--> Part is currently parented to Workspace\nprint(part.Parent)\n--> nil", "expectedOutput": "", "highlightLines": "" } ], "parameters": [ { "name": "descendant", "type": "Instance", "default": null, "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 5, "offset": 4 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance" } ], "position": { "start": { "line": 1, "column": 5, "offset": 4 }, "end": { "line": 1, "column": 21, "offset": 20 } } }, { "type": "text", "value": " that is being removed.", "position": { "start": { "line": 1, "column": 21, "offset": 20 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 44, "offset": 43 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } } } ], "tags": [], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Deprecation Message", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 20, "offset": 19 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 20, "offset": 19 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Instance.Destroying", "summary": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "Fires immediately before the instance is destroyed via\n", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 1, "offset": 55 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance:Destroy()" } ], "position": { "start": { "line": 2, "column": 1, "offset": 55 }, "end": { "line": 2, "column": 27, "offset": 81 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 2, "column": 27, "offset": 81 }, "end": { "line": 2, "column": 28, "offset": 82 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 28, "offset": 82 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "description": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The Destroying event fires immediately before the Instance or one of its\nancestors is destroyed with ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 29, "offset": 101 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Instance.Destroy()" } ], "position": { "start": { "line": 2, "column": 29, "offset": 101 }, "end": { "line": 2, "column": 49, "offset": 121 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 2, "column": 49, "offset": 121 }, "end": { "line": 2, "column": 50, "offset": 122 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 50, "offset": 122 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "The Instance will never be deleted from memory while a connected function\nis still using it. However, if the function yields at any point, the\nInstance and its descendants will be parented to ", "position": { "start": { "line": 4, "column": 1, "offset": 124 }, "end": { "line": 6, "column": 50, "offset": 316 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "nil" } ], "position": { "start": { "line": 6, "column": 50, "offset": 316 }, "end": { "line": 6, "column": 55, "offset": 321 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 6, "column": 55, "offset": 321 }, "end": { "line": 6, "column": 56, "offset": 322 } } } ], "position": { "start": { "line": 4, "column": 1, "offset": 124 }, "end": { "line": 6, "column": 56, "offset": 322 } } }, { "type": "text", "value": "\n" }, { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "When deleting an instance in Studio, such as manually deleting through the\nExplorer or through a plugin, the instance isn't destroyed. Instead, the\nparent is set to ", "position": { "start": { "line": 8, "column": 1, "offset": 324 }, "end": { "line": 10, "column": 18, "offset": 489 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "nil" } ], "position": { "start": { "line": 10, "column": 18, "offset": 489 }, "end": { "line": 10, "column": 23, "offset": 494 } } }, { "type": "text", "value": " which you can track with\n", "position": { "start": { "line": 10, "column": 23, "offset": 494 }, "end": { "line": 11, "column": 1, "offset": 520 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.AncestryChanged" } ], "position": { "start": { "line": 11, "column": 1, "offset": 520 }, "end": { "line": 11, "column": 33, "offset": 552 } } }, { "type": "text", "value": ".", "position": { "start": { "line": 11, "column": 33, "offset": 552 }, "end": { "line": 11, "column": 34, "offset": 553 } } } ], "position": { "start": { "line": 8, "column": 1, "offset": 324 }, "end": { "line": 11, "column": 34, "offset": 553 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "codeSamples": [ { "identifier": "Instance-Destroying", "displayName": "Using the Destroying Event", "description": "This sample demonstrates how an Instance being destroyed remains in place\nuntil the connected function yields.\n", "codeSample": "local part = Instance.new(\"Part\", workspace)\n \nlocal function onPartDestroying()\n\t\tprint(\"Before yielding:\", part:GetFullName(), #part:GetChildren())\n\t\ttask.wait()\n\t\tprint(\"After yielding:\", part:GetFullName(), #part:GetChildren())\nend\n \npart.Destroying:Connect(onPartDestroying)\n \npart:Destroy()", "expectedOutput": "Before yielding: Workspace.Part 1\nAfter yielding: Part 0", "highlightLines": "" } ], "parameters": [], "tags": [], "deprecationMessage": "", "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" }, { "name": "Instance.childAdded", "summary": "", "description": "", "codeSamples": null, "parameters": [ { "name": "child", "type": "Instance", "default": null, "summary": "" } ], "tags": [ "DEPRECATED" ], "deprecationMessage": { "type": "root", "children": [ { "type": "element", "tagName": "p", "properties": {}, "children": [ { "type": "text", "value": "This deprecated event is a variant of ", "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 39, "offset": 38 } } }, { "type": "element", "tagName": "code", "properties": {}, "children": [ { "type": "text", "value": "Class.Instance.ChildAdded" } ], "position": { "start": { "line": 1, "column": 39, "offset": 38 }, "end": { "line": 1, "column": 66, "offset": 65 } } }, { "type": "text", "value": " which\nshould be used instead.", "position": { "start": { "line": 1, "column": 66, "offset": 65 }, "end": { "line": 2, "column": 24, "offset": 95 } } } ], "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 2, "column": 24, "offset": 95 } } } ], "data": { "quirksMode": false }, "position": { "start": { "line": 1, "column": 1, "offset": 0 }, "end": { "line": 1, "column": 1, "offset": 0 } } }, "security": [ "NONE" ], "threadSafety": "UNSAFE", "__typename": "Event" } ], "callbacks": [], "__typename": "ClassReference", "id": "Instance", "slug": "Instance" } ], "description": "An object that represents a presently connected client to the game.\n", "type": "engineapi", "contentDirFilePath": "/reference/engine/classes/Player.yaml", "openGraphMeta": { "title": "Player", "description": "An object that represents a presently connected client to the game.\n", "imageUrl": "/assets/landing/engine/banner.jpg" } }, "isOpenSourced": false, "isPageFallback": false, "locale": "en-US" }, "__N_SSG": true }