tarrdo
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 476 |
|
|
| 17 Jul 2014 12:19 AM |
This is more of a request for either a partial script or a wiki/information page
I want to make a game that will tag a person as it and send it to the map before anyone else and I want it to morph them aswell. The most of a script I have is to send to map and it should probably be attached to map select script to it goes along the timer
function SendTo (Player) Map = {"Map1","Map2","Map3"} -- whatever the map is inside of Workspace S = ("1","2","3","4") -- whatever the brick is named that the player is being sent to spawn = S[math.random(1,#S)] actual:WaitForChild(spawn) actual = workspace:findFirstChild(Map[spawn]) --here game.Players.LocalPlayer.Character.Torso.CFrame = Workspace[math.random(4)].CFrame end |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2014 12:41 AM |
-- I put some of the stuff in global table so you can access from other scripts. :)
_G.chosen = nil; roundtime = 300; -- time of round, in seconds mdirectory = game.Workspace.Maps:GetChildren();
_G.pick = function() local map = mdirectory[math.random(1, #mdirectory)]; return map; end
_G.sendplayers = function(map) local pdirectory = game.Players:GetChildren(); for i =1,#pdirectory,1 do local spawn = _G.find(map); pdirectory[i].Character:MoveTo(spawn.Position, spawn); end end
_G.find = function(map) local sdir = map.Spawns:GetChildren(); local spawn = sdir[math.random(1, #sdir)]; return spawn; end _G.selectchosen = function() local pdir = game.Players:GetChildren(); _G.chosen = pdir[math.random(1,#pdir)]; end
while wait(roundtime) do _G.selectchosen(); _G.sendplayers(_G.pick()); end |
|
|
| Report Abuse |
|
|
tarrdo
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 476 |
|
|
| 17 Jul 2014 01:39 AM |
| So the _G means that I could just use the script anywhere and it would read the map and then send players to the spawn or brick chosen right? |
|
|
| Report Abuse |
|
|
alij12
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 1204 |
|
| |
|
tarrdo
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 476 |
|
|
| 17 Jul 2014 01:40 AM |
| And what if I want 2 or 3 chosen but all on different teams? |
|
|
| Report Abuse |
|
|
tarrdo
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 476 |
|
|
| 17 Jul 2014 01:59 AM |
| 02:58:51.533 - Maps is not a valid member of Workspace |
|
|
| Report Abuse |
|
|
tarrdo
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 476 |
|
|
| 17 Jul 2014 02:01 AM |
| Considering my maps arent named maps and if they were they would all spawn at once which wouldn't be good, how would I get around that. |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2014 12:42 PM |
Put all your maps into a model in Workspace, called maps. Put the spawns into the Maps, in a model called Spawns.
this is a signature: pcall(function() print([[apparently this is a string]]) end) |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2014 12:43 PM |
Whoops, put Maps in lighting and replace mdirectory = game.Workspace.Maps:GetChildren(); with mdirectory = game.Lighting.Maps:GetChildren();
this is a signature: pcall(function() print([[apparently this is a string]]) end) |
|
|
| Report Abuse |
|
|
tarrdo
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 476 |
|
|
| 17 Jul 2014 01:02 PM |
| They would all be in ServerStorage as the game is trying to move away from putting stuff in lighting. |
|
|
| Report Abuse |
|
|
tarrdo
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 476 |
|
|
| 17 Jul 2014 01:09 PM |
| Saddly by putting them in maps I now have to edit my map spawning script |
|
|
| Report Abuse |
|
|
tarrdo
|
  |
| Joined: 24 Jun 2008 |
| Total Posts: 476 |
|
|
| 17 Jul 2014 01:18 PM |
| It also didn't send me anywhere my map spawned fine, but it didnt send me to spawns. |
|
|
| Report Abuse |
|
|