|
| 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 |
|
|
| |
|
|
| 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
|
  |
| Joined: 12 Sep 2011 |
| Total Posts: 1323 |
|
| |
|
|
| 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 |
|
|
|
| 29 Sep 2011 09:35 PM |
| Thanks for the responses, but how do I send random people to random places? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|