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: Help with randomly teleporting

Previous Thread :: Next Thread 
Computermaster01 is online. Computermaster01
Joined: 29 May 2012
Total Posts: 369
08 Aug 2014 03:39 AM
So I am trying to figure out a way to telleport someone to a random position on each grid. So for example, on the X Grid, a random position between 1 and 10. I don't know how this would be done as there are many positions that would need to be to be added.
Report Abuse
Scriptman8 is not online. Scriptman8
Joined: 25 Dec 2011
Total Posts: 5561
08 Aug 2014 04:02 AM
Workspace.PlayerName.Torso.CFrame = CFrame.new(math.random(1,10),math.random(1,10), math.random(1,10))
Report Abuse
Caedus1x1x1x1 is not online. Caedus1x1x1x1
Joined: 22 Sep 2011
Total Posts: 258
08 Aug 2014 04:15 AM
I love math.random().
I used it to make randomly spawning-falling-rain drops once. c:
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
08 Aug 2014 04:16 AM
local x = math.random(minimum,maximum) --fill these in with the numbers you want it to randomely choose from EX: math.random(1,10) would do a number between or including 1 and 10.

local y = math.random(minumim,maximum)
local z = math.random(minimum,maximum)
plr = "Put the player name here"

game.Workspace:FindFirstChild(plr).Torso.CFrame = CFrame.new(x,y,z)
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