PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

GenerateGUID

The GenerateGUID function randomly creates a universally unique identifier (UUID) string.

The sixteen octets of a UUID are represented as 32 hexadecimal (base 16) digits, displayed in 5 groups separated by hyphens in the form 8-4-4-4-12 for a total of 36 characters. For example: 123e4567-e89b-12d3-a456-426655440000.

The wrapInCurlyBraces argument determines whether the returned string is wrapped in curly braces {}. For instance:

  • true - {94b717b2-d54f-4340-a504-bd809ef5bf5c}
  • false - db454790-7563-44ed-ab4b-397ff5df737b

Parameters

Name Type Default Description
true

Whether the returned string should be wrapped in {curly braces}

Returns

Return Type Summary

The randomly generated UUID


Code Samples


HttpService GenerateGUID

This example uses HttpService’s GenerateGUI method to generate and print a universally unique identifier.

local HttpService = game:GetService("HttpService")
local result = HttpService:GenerateGUID(true)
print(result) --> Example output: {04AEBFEA-87FC-480F-A98B-E5E221007A90}