dentify what kind of datatype is something and reverse it again to string.
local Obj = Vector3.new()
local Obj2 = game.Players.LocalPlayer
if FunctionToIdentifyDatatype(Obj) == "Vector3" then
print("Vector3.new("..Obj.X..","..Obj.Y..","..Obj.Z..")")
end
if FunctionToIdentifyDatatype(Obj2) == "Instance" then
print("game."..Obj2:GetFullName())
end
--Output
--Vector3.new(0,0,0)
--game.Players.UserName

3 comments
Yes, you can use typof.
https://devforum.roblox.com/t/new-typeof-global-function/29992
If this helps, please put [SOLVED] in the title of your question, so that people know you no longer need help.