xbladex7
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 364 |
|
|
| 07 Oct 2012 09:37 PM |
Hello every one my username is xbladex7 as you see and i need help i am in the making of a disasters game and i am stuck on the process of trying to teleport the lobby from the lobby obviously to the base plate if any one could help me with this script and give me the lay out it would be much appreciated
-yours truly Xbladex7 |
|
|
| Report Abuse |
|
|
xbladex7
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 364 |
|
|
| 07 Oct 2012 09:38 PM |
| when i mean lobby i mean players :) |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2012 09:50 PM |
game.Workspace.Player.Torso.CFrame = CFrame.new(Vector3.new(0, 50, 0))
So, in pseudo (false) code:
if the player is in lobby and wants to join game then game.Workspace.Player.Torso.CFrame = CFrame.new(Vector3.new(0, 50, 0)) else end
Of course you would need to find out WHICH players, and change "game.Workspace.Player.Torso.CFrame = CFrame.new(Vector3.new(0, 50, 0))" to the location of the baseplate, and stuff.... |
|
|
| Report Abuse |
|
|
xbladex7
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 364 |
|
|
| 07 Oct 2012 09:52 PM |
| cool but how would you teleport them back lets say the waiting time is 20 seconds in the lobby like you said the script will telaport them to the base plate how would you telaport them back after the disaster is finished. |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2012 10:01 PM |
First of all, next time go to scripting helpers, unless you have an advanced topic such as metatables
Say the lobby is located at (100,200,300) And the base is located at (400,500,600)
---------------------------------------------------------------------
disasterTime = 20 --In seconds function teleport() for i, player in ipairs(game.Players:GetChildren()) do player.Character.Torso.CFrame = CFrame.new(Vector3.new(400, 500, 600)) --Baseplate wait(disasterTime) player.Character.Torso.CFrame = CFrame.new(Vector3.new(100, 200, 300)) --Lobby end end
Then you just call teleport() and it will teleport you to base, wait for the disasterTime, and teleport you back to the lobby. If you want a loop, I could also fix it for that, just ask. |
|
|
| Report Abuse |
|
|
xbladex7
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 364 |
|
|
| 07 Oct 2012 10:03 PM |
| Could you please :) thank you so much your a life saver |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2012 10:13 PM |
-------------------------Settings--------------------------------------------- disasterTime = 20 --Time disasters last, in seconds inBetweenTime = 60 --Time in between disasters, in the Lobby, in seconds lX = 0 --Lobby's X coordinate lY = 0 --Lobby's Y coordinate lZ = 0 --Lobby's Z coordinate bX = 0 --Baseplate's X coordinate bY = 0 --Baseplate's Y coordinate bZ = 0 --Baseplate's Z coordinate -------------------------Settings---------------------------------------------
function teleport() for i, player in ipairs(game.Players:GetChildren()) do wait(inBetweenTime) player.Character.Torso.CFrame = CFrame.new(Vector3.new(bX, bY, bZ)) wait(disasterTime) player.Character.Torso.CFrame = CFrame.new(Vector3.new(lX, lY, lZ)) end end
while true do teleport() end |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2012 10:44 PM |
Instead of getting all those read-only individual coordinates, can't you just say
...Torso.CFrame = workspace.Part1.CFrame |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2012 11:42 AM |
| I beleive so, but I am not very experienced using CFrames, and I just basically took that snippet and typed it, straight of the wiki. |
|
|
| Report Abuse |
|
|