Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function rbxType(this)
- local rawType = type(this)
- if rawType == "userdata" then
- local meta = getmetatable(this)
- if meta == "The metatable is locked" then
- local success,errorMsg = pcall(function ()
- return workspace:FindPartOnRay(this)
- end)
- if success then
- return "Ray"
- else
- local rbxType = errorMsg:sub(16,#errorMsg-7)
- if rbxType == "token" then
- return "EnumItem"
- else
- local asString = tostring(this)
- if rbxType == "int" then -- Most likely a BrickColor?
- if asString == "Medium stone grey" or tostring(BrickColor.new(asString)) ~= "Medium stone grey" then
- return "BrickColor"
- else -- ...okay?
- return rbxType
- end
- elseif rbxType == "void" then
- if this.GetEnumItems then
- return "Enum"
- elseif asString == "Connection" then
- return "RBXScriptConnection"
- elseif asString:sub(1,6) == "Signal" then
- return "RBXScriptSignal"
- elseif asString == "Enums" then
- return asString
- elseif this.Help then
- return "RbxLibrary"
- else
- return rbxType
- end
- else
- return rbxType
- end
- end
- end
- else -- newproxy?
- return rawType
- end
- else
- return rawType
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement