|
| 02 Aug 2013 12:32 PM |
translating it to a string make it result in UserData(AEASD323) -- or some other UserDate Value
I do not know if i matters but here is my code:
while true do wait(0.03) local up1 = gui2.p1.Hold
up1.Value = "UDim2.new("..gui2.p1.Position.X..","..gui2.p1.Position.Y..")" wait(0.03)end |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:40 PM |
| I should rephrase how can I change a userdata value into a string. |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:42 PM |
| What exactly are you trying to do.... What user data value are you trying to turn into a string? |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:43 PM |
| The userdata value Position. |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Aug 2013 12:47 PM |
| It just makes the string userdata: 13BBF090 or the same thing with a different letter/number sequence on the second half. |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:48 PM |
| I'm confused.... Why are you trying to convert a udim2 to a string? |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 02 Aug 2013 12:48 PM |
Userdatas act like Tables from what I understand.
Though not all userdatas return 'userdata: hex' when printing, some do. Ex, Vector3 returns X Y Z when printed.
The 'hex' part of the output you get is the hexdecimal address...
ALSO! If you want to turn... I guess I got all data types except instances... into strings and back again, you can use my toString and toData functions.
Do not use the model I'm sending you below, but take out the toString and toData functions, as they should work 100%.
http://www.roblox.com/Instance-to-string-String-to-instance-item?id=116408242
Example of turning UDim2.new(0.5, 100, 0, 1337) into a string:
print(toString(UDim2.new(0.5, 100, 0, 1337))) > u2:0.5,100,0,1337
- As, hm, what was I about to do. Oh yes, turn brains to dust. |
|
|
| Report Abuse |
|
|
iIikeyou
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 1659 |
|
|
| 02 Aug 2013 12:49 PM |
| 'UDim2.new('..obj.X.Scale..','..obj.X.Offset..','..obj.Y.Scale..','..obj.Y.Offset..')' |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 12:51 PM |
"I'm confused.... Why are you trying to convert a udim2 to a string?"
For my chat gui It will not let me compare the position of a text label to UDim2.new() so I wanted to improvise. |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2013 01:01 PM |
Here's how I .Name a Part, a Vector3 Value:
. . . local HexName = Vector3.new(1,1,1) -- Follow this Var local face = 1 -- THIS local yName = 1 -- THIS local xName = 1 -- & THIS local yPrime = .1 local xPrime = .1
local Globe = Instance.new("Model", Workspace)
function cubeToSphere(x,y,z) return Vector3.new( x*math.sqrt(1-y^2/2-z^2/2+(y^2*z^2)/3), y*math.sqrt(1-z^2/2-x^2/2+(x^2*z^2)/3), z*math.sqrt(1-x^2/2-y^2/2+(x^2*y^2)/3) ); end
function Draw(point) Part = Instance.new("Part", Globe) --if color == Color3.new(1,1,1) then --Part.Shape = "Ball" --end
Part.Size = PSize HexName = Vector3.new(xName,yName,Face) Part.Name = tostring(HexName)
local origin = CFrame.new(point,Vector3.new(0,0,0)) Part.CFrame = CFrame.new(point*1,Vector3.new(0,0,0)) Part.Anchored = true
Part.Transparency = 0 Part.BrickColor =BrickColor.new(color)
local r = math.random() if r < 1 then --.1 then for i = 1, #city do local part = city[i]:Clone()
local rel = centerPoint:toObjectSpace(part.CFrame); print(part) part.CFrame = origin:toWorldSpace(rel);
part.Parent = Globe part.Anchored = true end -- Stamp parts
elseif r < 1 then Part.Transparency = 1
end -- land? Part.Transparency = 1 end -- draw
local t_height=240;--how high up it is, this does not change for a cube local offset=0 for x = -10, 10, 1 do -- aND THIS, BUT I LOST THE PLOT AT THIS POINT.... xName = x xPrime = x/10
if offset == 0 then -- offset = .05 else offset = 0 end -- offset flip
for y = -10, 10, 1 do yName = y yPrime = y/10 + offset
PSize = Vector3.new(14,16,1) face = 1 if y < 10 and x < 10 then Face = 1 color = Color3.new(0,0,0) local sphere_point=cubeToSphere(xPrime, 1, yPrime); Draw(sphere_point*t_height) end . . . |
|
|
| Report Abuse |
|
|