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 Script Help.

Previous Thread :: Next Thread 
DangCool is not online. DangCool
Joined: 27 Apr 2010
Total Posts: 5568
03 Dec 2012 12:15 PM
So when i do this:

local par1TXT = "";
while true do
par1TXT = game.Workspace.DangCool.Torso.Postion.X
end

How would I make it so it doesn't give you a a bunch of other numbers
Example: My Position for "X" : 2.0301231053456

I just want it to show the number "2"

I'm a Mini - Mod
Report Abuse
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
03 Dec 2012 01:59 PM
local par1TXT = "";
while wait() do
par1TXT = math.floor(game.Workspace.DangCool.Torso.Postion.X)
end

math.floor rounds your number down.
Report Abuse
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
03 Dec 2012 02:00 PM
local par1TXT = "";
while wait() do
par1TXT = math.floor(game.Workspace.DangCool.Torso.Postion.X + .5)
end

math.floor(x+0.5) rounds your number to the closest integer
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
03 Dec 2012 02:02 PM
math.floor(x+0.5)

rounds x to the nearest whole number (2.7 to 3 instead of 2), just if that's helpful.
Report Abuse
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
03 Dec 2012 02:24 PM
that's what I posted :P
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