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: What's the correct way to write this line?

Previous Thread :: Next Thread 
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
28 May 2012 06:26 PM
if v.Position.Z == 55.5 then
does not work, nothing in output
Report Abuse
nickmaster24 is not online. nickmaster24
Joined: 04 Oct 2008
Total Posts: 8906
28 May 2012 06:32 PM
That looks like correct syntax to me. Is v.Position.Z nil?

~Read Between The Squiggles~
Report Abuse
CloneTrooper1019 is not online. CloneTrooper1019
Joined: 19 Jan 2009
Total Posts: 6227
28 May 2012 06:34 PM
v.Position.Z == 55.5

Im not sure if that will work.

Try it with CFrame.

v.CFrame.Z == 55.5
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
28 May 2012 06:34 PM
no. I don't even know how that could be possible lol
I tried putting .Value after the Z and it gave me a red error in the output
"attempt to index field 'Z' (a number value)
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
28 May 2012 06:38 PM
if v.CFrame.z == 55.5 then
print("oyus")
else
print("nawp")
end
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
28 May 2012 06:41 PM
CFrame did not work either
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
28 May 2012 06:46 PM
if v.Positon.z == 55.5 then
print("oyus")
else
print(v.Position.z .. " ~= 55.5")
end
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
28 May 2012 06:47 PM
Why are you typing that? Are you saying that z does not need to be capitalized?
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
28 May 2012 07:11 PM
bump
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
28 May 2012 08:16 PM
bump
Report Abuse
malachi11 is not online. malachi11
Joined: 07 May 2008
Total Posts: 2420
28 May 2012 08:18 PM
z, y, and x are read-only properties of Vector3. You could do this:

p.Position=Vector3.new(p.Position.x,p.Position.y,number)
Report Abuse
silverfire17 is not online. silverfire17
Joined: 28 Jan 2012
Total Posts: 42
28 May 2012 08:20 PM
Is this part of a larger script?
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
28 May 2012 08:20 PM
Dokes, the chances of it being EXACTLY 55.5 are next to 0. Try checking if it's between 55.4 and 55.6
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
28 May 2012 08:25 PM
This is part of a larger script.
And why would it not be exactly 55.5? It's anchored and that's what it says on it's position.
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
28 May 2012 08:26 PM
It rounds. Just do as I say, I promise it will work.
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
28 May 2012 08:26 PM
I'll try that malachi, good idea.
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
28 May 2012 08:27 PM
Will you type the exact thing you want me to try please?
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
28 May 2012 08:28 PM
> z, y, and x are read-only properties of Vector3. You could do this:

Uh, he IS reading them?
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
28 May 2012 08:28 PM
my last post was at kingkiller by the way
Report Abuse
kingkiller1000 is not online. kingkiller1000
Joined: 12 Dec 2008
Total Posts: 26415
28 May 2012 08:28 PM
if v.Position.Z ​> 55.4 and v.Position.Z < 55.6 then
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
28 May 2012 08:29 PM
okay be right back
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
28 May 2012 08:40 PM
It worked! Thanks for helping me and keeping your promise.
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