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: Teleporting player scripts.

Previous Thread :: Next Thread 
mostwanted1 is not online. mostwanted1
Joined: 21 Dec 2010
Total Posts: 511
29 Sep 2011 09:02 PM
Hello, I'm pretty good with Scripting. I'm here because I've tried so many things to teleport players on the map in specific places but I can only tele one.
This is what I have:

-- Configuration
local mapDirectory = game.Lighting.Maps
local msg = Instance.new("Message")
msg.Parent = game.Lighting
local time = script.Time
-- Script


--Loop
while true do
local maps = mapDirectory:getChildren()


--This is the fail safe
if #maps == 0 then
print("Maps not found! Selfremoving...")
script:remove()
return
end
--Fail Safe Ends


--Part that picks maps
local pickedMap = maps[math.random(1, #maps)]
local pickedMapClone = pickedMap:clone()
pickedMapClone.Parent = game.Workspace
pickedMapClone:makeJoints()
msg.Parent = game.Workspace
msg.Text = "Battle fields are being changed!"
wait(3)
msg.Text = "Battle field chosen: " ..pickedMapClone.Name.."."
print("Battle field inserted: " .. pickedMap.Name)
wait(3)
msg.Text = "Good Luck!"
wait(2)
msg.Parent = game.Lighting
wait(time.Value)
pickedMapClone:remove()


end
Report Abuse
mostwanted1 is not online. mostwanted1
Joined: 21 Dec 2010
Total Posts: 511
29 Sep 2011 09:16 PM
Bump.
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
29 Sep 2011 09:18 PM
function SendPlayerToArea(PlayerName,Where)
local CurrentTarget = game.Players:findFirstChild(PlayerName)
if CurrentTarget then
CurrentTarget.Character:MoveTo(Where)
else
print("Player " ..PlayerName.. " not found! ):")
end
end

SendPlayerToArea("RoboTestGear",Vector3.new(1,1,1))
Report Abuse
Lowcart is not online. Lowcart
Joined: 12 Sep 2011
Total Posts: 1323
29 Sep 2011 09:18 PM
[ Content Deleted ]
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
29 Sep 2011 09:22 PM
players = game.Players:GetChildren()
for i=1,#players do
SendPlayerToArea(players[i].Name,Vector3.new(1,1,1))
end

--:p
Report Abuse
mostwanted1 is not online. mostwanted1
Joined: 21 Dec 2010
Total Posts: 511
29 Sep 2011 09:35 PM
Thanks for the responses, but how do I send random people to random places?
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
29 Sep 2011 09:37 PM
players = game.Players:GetChildren()
for i=1,#players do
players[i].Character:MoveTo(Vector3.new(math.random(1,10),10,math.random(1,200))
end
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