|
| 02 May 2014 11:36 PM |
--SCRIPT--
local fram = script.Parent.SurfaceGui.Frame local text = fram.TextLabel while true do wait() if text.Position > UDim2.new(1,0,0,0)then text.Position = text.Position + UDim2.new(.1,0,0,0) elseif text.Position == UDim2.new(1,0,0,0) then text.Position = UDim2.new(-1,0,0,0) end end
--ERROR--
22:34:18.571 - Workspace.Part.Script:5: attempt to compare two userdata values |
|
|
| Report Abuse |
|
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 03 May 2014 12:57 AM |
if text.Position > UDim2.new(1,0,0,0)then
Tell me how you expect it to compare those. |
|
|
| Report Abuse |
|
|
|
| 03 May 2014 01:15 AM |
| But it's comparing a UDim2 to another UDim2 |
|
|
| Report Abuse |
|
|
Durfungus
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 15988 |
|
|
| 03 May 2014 01:16 AM |
.position is a read only value its not 4 udim2 values
[HELP, DURFUNGUS IS SPREADING] Twitter - @Durfungus |
|
|
| Report Abuse |
|
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 03 May 2014 02:17 AM |
But what do you expect it to do? How do you expect it to compare them? Think about it
UDim2.new(1, 2, 3, 4) UDim2.new(4, 3, 2, 1)
Neither one is bigger. They can't be compared. |
|
|
| Report Abuse |
|
|
georgeba
|
  |
| Joined: 29 Oct 2011 |
| Total Posts: 1092 |
|
|
| 03 May 2014 02:43 AM |
| Wait, do you mind which telling us which line is line #5? |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 03 May 2014 02:48 AM |
...Its this one
if text.Position > UDim2.new(1,0,0,0)then |
|
|
| Report Abuse |
|
|
| |
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 03 May 2014 01:26 PM |
| Well depends, what are you trying to check? |
|
|
| Report Abuse |
|
|
|
| 03 May 2014 01:33 PM |
| This script is supposed to make a textlabel continuously scroll across the screen until it gets to the other side, where it is supposed to detect it (that's where the comparing comes in) if it's not to the other side yet, it keeps moving it, but if it is, it teleports it to the beginning |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
| |
|
|
| 04 May 2014 12:51 AM |
| No output, but it still doesn't work |
|
|
| Report Abuse |
|
|
|
| 04 May 2014 03:14 AM |
local fram = script.Parent.SurfaceGui.Frame local text = fram.TextLabel while true do wait() if text.Position >= UDim2.new(1,0,0,0)then text.Position = text.Position + UDim2.new(.1,0,0,0) elseif text.Position == UDim2.new(1,0,0,0) then text.Position = UDim2.new(-1,0,0,0) end end |
|
|
| Report Abuse |
|
|