generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Position

Previous Thread :: Next Thread 
nathan2469 is not online. nathan2469
Joined: 23 Jul 2008
Total Posts: 1731
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
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
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 is not online. blox6137
Joined: 23 Nov 2008
Total Posts: 1109
21 Jul 2014 05:04 AM
Erm... Not really understanding your question.
Report Abuse
nathan2469 is not online. nathan2469
Joined: 23 Jul 2008
Total Posts: 1731
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 is not online. 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 is not online. 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 is not online. 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
nathan2469 is not online. nathan2469
Joined: 23 Jul 2008
Total Posts: 1731
21 Jul 2014 05:08 AM
Thank you. After reading the op I understand why none of you really understood :l
Report Abuse
blox6137 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image