|
| 21 Jul 2014 04:59 AM |
How do you get an "If Example == Example2 then" to recognize position? I've tried many things and I cannot figure it out.. :l
#newbagquestion |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2014 05:01 AM |
If you're referring to the position of a Part then an example would be something such as, if game.Workspace.One.Position == game.Workspace.Two.Position then print("Correct") end |
|
|
| Report Abuse |
|
|
blox6137
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 1109 |
|
|
| 21 Jul 2014 05:04 AM |
| Erm... Not really understanding your question. |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2014 05:05 AM |
| Well, what I meant was that i'm attempting to make a call elevator button, and I want the button to know whether or not the elevator is on the same floor as the button. |
|
|
| Report Abuse |
|
|
blox6137
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 1109 |
|
|
| 21 Jul 2014 05:06 AM |
if example.Position == Vector3.new(a, a, a) --code end Something like that should do it. |
|
|
| Report Abuse |
|
|
UncleTaz
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 12795 |
|
|
| 21 Jul 2014 05:07 AM |
Oh that.
If Floor.Position == Vector3.new(x,y,z) then --code else --code end |
|
|
| Report Abuse |
|
|
blox6137
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 1109 |
|
|
| 21 Jul 2014 05:08 AM |
| ogm forget then at the end of mine *FACEPLAM* |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2014 05:08 AM |
| Thank you. After reading the op I understand why none of you really understood :l |
|
|
| Report Abuse |
|
|
blox6137
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 1109 |
|
|
| 21 Jul 2014 05:12 AM |
local elevator = script.Parent
if example.Position == Vector3.new(x, y, z) then return end else elevator:MoveTo(Vector3.new(x, y, z)) end
this could work. |
|
|
| Report Abuse |
|
|
blox6137
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 1109 |
|
|
| 21 Jul 2014 05:14 AM |
Crap, don't use my script above this one, use this one:
~~~~
local elevator = script.Parent
if elevator.Position == Vector3.new(x, y, z) then --change xyz return end else elevator:MoveTo(Vector3.new(x, y, z))--change xyz end
~~~~
I'm not sure if you could use the MoveTo method with models though...
http://wiki.roblox.com/index.php/MoveTo_%28Method%29 |
|
|
| Report Abuse |
|
|