call23re
|
  |
| Joined: 11 Nov 2010 |
| Total Posts: 9070 |
|
|
| 23 Dec 2013 12:10 AM |
I'm making it so after an amount of time all the players teleport to a random place on the map. I don't really know how to do any of these things but I'll try and post my code here. I already have the countdown though.
-"The wise never quote." |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Dec 2013 12:11 AM |
| You mean characters? Just use a generic for loop |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2013 12:14 AM |
--PS this may not work, i feel like Im forgetting something...
for i,v in pairs(game.Players:getChildren()) do if v.Character then p = v.Character p.Torso.CFrame = CFrame.new(POSITION HERE) end end
that will teleport only once, make a loop if you want them to teleport there over and over, add it to your countdown. |
|
|
| Report Abuse |
|
|
call23re
|
  |
| Joined: 11 Nov 2010 |
| Total Posts: 9070 |
|
|
| 23 Dec 2013 12:20 AM |
okay but I'm trying to make it so that it will teleport you to a random position I don't know what I would use for that. math.random?
-"The wise never quote." |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2013 12:21 AM |
| I guess, But youll need to insert a limit of where to where for math.random, otherwise they would teleport off the map and stuff. |
|
|
| Report Abuse |
|
|
call23re
|
  |
| Joined: 11 Nov 2010 |
| Total Posts: 9070 |
|
|
| 23 Dec 2013 12:22 AM |
Yeah I was thinking the same thing. So would I have to like set a position in every corner of the map or something. I don't really understand that.
-"The wise never quote." |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2013 12:24 AM |
| (math.random(max,max),math.random(max,max),math.random(max,max)) replace max with the maximum way they can go that direction. For the middle one, it would be how high they can teleport for the max. such as (0,5), that would make it so they couldnt teleport over 5 studs on the y axis. |
|
|
| Report Abuse |
|
|
call23re
|
  |
| Joined: 11 Nov 2010 |
| Total Posts: 9070 |
|
|
| 23 Dec 2013 12:29 AM |
okay so if the x axis was 512 would it be: (512,0) or (0,512)?
-"The wise never quote." |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2013 12:31 AM |
| (0,512) The first number is min, the 2nd is the max, but I think (512,0) should work too...Try both and see, but I know for sure (0,512) would be it. |
|
|
| Report Abuse |
|
|
call23re
|
  |
| Joined: 11 Nov 2010 |
| Total Posts: 9070 |
|
|
| 23 Dec 2013 12:32 AM |
well I just tried it with (0,512) and my player was spawned off to the side of the map
-"The wise never quote." |
|
|
| Report Abuse |
|
|
thermaI
|
  |
| Joined: 22 Sep 2013 |
| Total Posts: 70 |
|
| |
|
|
| 23 Dec 2013 12:34 AM |
| 0,512 would make it so they can teleport anywhere from the x axis from 0 up to 512. If you try it again it might take you somewhere else. |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2013 12:34 AM |
| Therman, That wouldnt work in a math.random(0,512), I think you just joined in thinking we were doing vector 3... |
|
|
| Report Abuse |
|
|
call23re
|
  |
| Joined: 11 Nov 2010 |
| Total Posts: 9070 |
|
|
| 23 Dec 2013 12:37 AM |
so if the map was 512x512 pixels long what would I do? I have (math.random(512,0),math.random(0,5),math.random(512,0))
-"The wise never quote." |
|
|
| Report Abuse |
|
|
call23re
|
  |
| Joined: 11 Nov 2010 |
| Total Posts: 9070 |
|
|
| 23 Dec 2013 12:38 AM |
err no I posted the wrong thing I have (math.random(0,512),math.random(0,5),math.random(0,512))
-"The wise never quote." |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2013 12:38 AM |
| (math.random(0,512),math.random(0,5),math.random(0,512) that should work. Although I havent used this for a month...I may be rusty. |
|
|
| Report Abuse |
|
|
call23re
|
  |
| Joined: 11 Nov 2010 |
| Total Posts: 9070 |
|
|
| 23 Dec 2013 12:39 AM |
well I tried that and I was teleported off the map...
-"The wise never quote." |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2013 12:39 AM |
| Give me the position of the map. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Dec 2013 12:39 AM |
I think you guys are jumping to conclusions, if the brick size is 512, then you should do the position like so: math.random(-256, 256) |
|
|
| Report Abuse |
|
|
thermaI
|
  |
| Joined: 22 Sep 2013 |
| Total Posts: 70 |
|
|
| 23 Dec 2013 12:41 AM |
| Silence Foolish 1 Y Wuuud U Have Tha Same number randomized Just loop it Boi |
|
|
| Report Abuse |
|
|
call23re
|
  |
| Joined: 11 Nov 2010 |
| Total Posts: 9070 |
|
|
| 23 Dec 2013 12:48 AM |
well this is the position:0, -0.61, 0 and I have tried all of this but cntkillme yours says it expects vector3's
-"The wise never quote." |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Dec 2013 12:49 AM |
| I didn't give you a script. |
|
|
| Report Abuse |
|
|
call23re
|
  |
| Joined: 11 Nov 2010 |
| Total Posts: 9070 |
|
|
| 23 Dec 2013 12:51 AM |
I mean your method. math.random(-256, 256)
-"The wise never quote." |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 23 Dec 2013 12:53 AM |
| Yeah, but I didn't expect you to actually use it, I was just saying that if you are positioning it relative to a brick what is 512 studs in length and width, they need to do that (assuming the position of it as 0, 0, 0 |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2013 12:54 AM |
| 0, -0.61, 0 thats the position of the brick? Hmm. What about the size (x,y,z) |
|
|
| Report Abuse |
|
|