generateGUID roblox studio code example

Example: roblox guid definition

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

if you want to get rid of the dashes (-) then do this:

function getGUID()
	return string.gsub(game:GetService('HttpService'):GenerateGUID(false), "-", "");
end
print(getGUID())

Tags:

Misc Example