GetDebugId (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>MrNicNac
You did not need the brackets around the object.
m Text replacement - "<SyntaxHighlight code="lua">" to "<syntaxhighlight lang="lua">"
Tags: mobile web edit mobile edit
 
(42 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{locked}}
<onlyinclude>{{Method
<onlyinclude>{{Method
|name = GetDebugId
|name = GetDebugId
|arguments = [[Integer]] ''scopeLength''
|arguments = {{type|int}} <var>scopeLength</var>
|returns = [[String]] ''DebugId''
|returns = {{type|string}}
|description = Returns a coded string of the object's DebugId.
|description = Returns a coded {{type|string}} of the object's DebugId used internally by Roblox.
|protected = yes
|object = Instance
|object = Instance
|protected = yes
}}</onlyinclude>
}}</onlyinclude>


{{clear floats}}


 
{{Example|<syntaxhighlight lang="lua">function debugId(object, scopeLength)
 
   return object:GetDebugId(scopeLength)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Here's an example of how to use GetDebugId():
 
<pre>
function debugId( object, scopeLength )
   return object:GetDebugId( scopeLength )
end
end


print(debugId(Workspace)) --> 39FA_12
print(debugId(Workspace, 10)) --> 39FA2FEF4D_12
print(debugId(Workspace, math.huge)) --> 12
</syntaxhighlight>}}


print( debugId( Workspace ) ) --> 39FA_12
== DebugID ==
print( debugId( Workspace, 10 ) ) --> 39FA2FEF4D_12
A debug ID is an ID used in debugging processes. It allows a debugger to read each instruction before an application processes it. All objects in Roblox act like processes and each run instructions (or 'code') that can be debugged if needed.
print( debugId( Workspace, math.huge ) ) --> 12
 
</pre>


[[Category:Methods]]
[[Category:Methods]]

Latest revision as of 06:08, 27 April 2023

Protected:This item is protected. Attempting to use it in a Script or LocalScript will cause an error.
GetDebugId( int scopeLength )
Returns string
Description: Returns a coded string of the object's DebugId used internally by Roblox.
Member of: Instance


Example
function debugId(object, scopeLength)
   return object:GetDebugId(scopeLength)
end

print(debugId(Workspace)) --> 39FA_12
print(debugId(Workspace, 10)) --> 39FA2FEF4D_12
print(debugId(Workspace, math.huge)) --> 12


DebugID

A debug ID is an ID used in debugging processes. It allows a debugger to read each instruction before an application processes it. All objects in Roblox act like processes and each run instructions (or 'code') that can be debugged if needed.