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
 

Help

Previous Thread :: Next Thread 
tarrdo is not online. 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
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
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 is not online. 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 is not online. alij12
Joined: 03 Oct 2011
Total Posts: 1204
17 Jul 2014 01:40 AM
Yea the _G means Global
Report Abuse
tarrdo is not online. 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 is not online. 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 is not online. 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
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
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
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
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 is not online. 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 is not online. 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 is not online. 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
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