Never did much work with GUIDs myself, so I don't know which is used for what, sorry.
But regarding getting the first part of the string, your syntax for :sub is wrong (e.g. starts at 5th char and includes the dash).
You could try one of the following:
Code:
bb = strsplit("-", casterGUID) -- split string on dashes, assign the first resulting string to BB, discard rest
bb = strmatch(casterGUID, "^([^-]+)") -- get the longest sequence of non-dash characters starting at the beginning of the string