|
| 10 Nov 2012 11:52 AM |
| Hey, I want to teleport players to one of 4 positions randomly. Most help Didn't work, One guy said to check out a roblox LUA website, i found teleporting players, it didnt work... can anyone help? thanks! |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 11:54 AM |
| Make a table that has the 4 positions in it and then make it teleport the players to it using a for loop to get all the players. Use math.random to make it randomly teleport them to the positions. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 11:58 AM |
| Okay, But how do i get the players to get teleported?? |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 11:58 AM |
Please, don't say LUA. It bugs me so much.
position1 = (5,5,5) position2 = (45,22,33) position3 = (34,64,2) position4 - (3,5,22)
function playermove(playername) local num = math.random(1,4) if num == 1 then playername:MoveTo(position1) elseif num == 2 then playername:MoveTo(position2) elseif num == 3 then playername:MoveTo(position3) else playername:MoveTo(position4) end end
--If you want the function to execute, say
playermove("NAMEOFPERSONHERE")
--ex. playermove("TheAwesomenessDude") |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 12:00 PM |
| position1/2/3/4 are the 4 positions that you want. I haven't tested it yet, so if it doesn't work tell me :) |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 12:07 PM |
| Okay thanks :) also i cant put in playernames.. i need it to teleport any player in the game |
|
|
| Report Abuse |
|
|
Taniss99
|
  |
| Joined: 15 Dec 2007 |
| Total Posts: 1707 |
|
|
| 10 Nov 2012 12:14 PM |
| Then turn it to an onTouch:connect function. And just get the touched part |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 12:16 PM |
| I cant really make it an ontouched part.. how do i get them to get to the postition? |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 12:18 PM |
| Ok so you want it to work for any player, but how and when? Are you making a teleport button so when they click it the teleport? Or when they touch a brick they teleport? If you tell me specifically then I can edit it for you. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 12:22 PM |
| It's something like Workspace.Player.LocalPlayer idk :P i thought that would find any player in the game? |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 12:26 PM |
Well what do you want to trigger the teleportation? It won't happen by itself.
I'm asking if you want:
A teleport brick where you touch it and you teleport? A teleport gui? A teleport brick where you click it and you teleport?
There are so many more options, that is all I'm asking. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 12:34 PM |
Well, I have a script that first prints a message on the screen, then when its done, (I put the messages and wait functions and everything) I want the player to automatically teleport to one of the positions i need them to go to. So really nothing being clicked or touched, just going to the position.
Btw sorry for not saying this before :P |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 10 Nov 2012 12:51 PM |
Do you want every player to teleport to a random position? If so, try this:
positions = {"5,5,5","45,22,33","34,64,2","3,5,22"}
function playermove(playername) playername.Character:MoveTo(Vector3.new(positions[math.random(1,#postions)])) end end
for _,v in pairs(game.Players:GetPlayers()) do playermove(v.Name) end
~ thedeathmaster01 ~ |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|