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: Teleport to random spot on map

Previous Thread :: Next Thread 
Cheeseninja15 is not online. Cheeseninja15
Joined: 01 Dec 2013
Total Posts: 15
28 Dec 2013 11:03 AM
If there are set points on a map, how do I make a Gui that when clicked teleports you from the lobby to one of the set points randomly?
Report Abuse
Smiley5991 is not online. Smiley5991
Joined: 15 Sep 2009
Total Posts: 259
28 Dec 2013 11:08 AM
Put the parts in a model.

script.Parent.MouseButton1Up:connect(function(player)
points = map.Points:GetChildren()
player.Character.Torso.CFrame = points[math.random(1,#points)]
end)
Report Abuse
Cheeseninja15 is not online. Cheeseninja15
Joined: 01 Dec 2013
Total Posts: 15
28 Dec 2013 11:09 AM
Where would the script be put in?
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
28 Dec 2013 11:10 AM
gui = script.Parent
player = script.Parent.....Character

points = {
Vector3.new(0,0,0),
Vector3.new(0,0,0),
Vector3.new(0,0,0),
Vector3.new(0,0,0)

}

gui.MouseButtonDown1:connect(function()
local m = math.random(1,#points)
player:MoveTo(points[m])
end)

Changing the variables to match your studio, that should work fine
Report Abuse
Smiley5991 is not online. Smiley5991
Joined: 15 Sep 2009
Total Posts: 259
28 Dec 2013 11:16 AM
The script I posted shops go in the button.

You have to change the path to the model with the parts that you want a player to be teleported too.

Mine is much better than Rofl's.
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
28 Dec 2013 12:00 PM
@smiley5991

The MouseButtonDown1 event does not return the player who clicked it, rendering your script broken. So guess again you cur!
Report Abuse
Smiley5991 is not online. Smiley5991
Joined: 15 Sep 2009
Total Posts: 259
28 Dec 2013 12:46 PM
Not the hard to fix:

script.Parent.MouseButton1Up:connect(function()
points = workspace.map.Points:GetChildren()
script.Parent.Parent.Parent.Character.Torso.CFrame = points[math.random(1,#points)]
end)

guess again kid
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
28 Dec 2013 12:58 PM
Have I done something to offend you? haha

Your script tries to set the Torsos CFrame to a Vector3, so it's still broken! ooh!
Report Abuse
Smiley5991 is not online. Smiley5991
Joined: 15 Sep 2009
Total Posts: 259
28 Dec 2013 12:58 PM
"So guess again you cur!"
I think this is an insult?
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
28 Dec 2013 01:00 PM
woosh. sorry for using sarcasm.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
28 Dec 2013 01:03 PM
Stop acting like 5 yr olds..he wants an answer..not to be a babysitter..OWNED
Now stop
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
28 Dec 2013 01:08 PM
Oh please.
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