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 » Scripters
Home Search
 

Re: Only Teleporting Some Players...

Previous Thread :: Next Thread 
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
30 Sep 2016 10:58 PM
message("Time To Start The Game!",5);
for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor==away.TeamColor then
v.Character.Torso.CFrame=CFrame.new(92.212, 1.001, -49.616)
else
if v.TeamColor==home.TeamColor then
v.Character.Torso.CFrame=CFrame.new(-92.308, 1.049, 361.391)
wait(7)
message("Here Are This Matchup's Teams!",5)
wait(7)
message((away.Name).." Is Your Away Team!",5);
game.Workspace.awayroom.door.CanCollide = false
game.Workspace.awayroom.door.Transparency = 1
wait(10)
game.Workspace.awayroom.door.CanCollide = true
game.Workspace.awayroom.door.Transparency = 0
wait(5)
message("Here Are Your "..home.Name,5);
game.Workspace.homeroom.door.CanCollide = false
game.Workspace.homeroom.door.Transparency = 1
wait(10)
game.Workspace.homeroom.door.CanCollide = true
game.Workspace.homeroom.door.Transparency = 0
end end end
Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
30 Sep 2016 10:59 PM
Don't worry about the stuff on the bottom.. Its just the stuff on top... the for loops!
It only teleports a couple of players to the room... The CFrame destination is a brick position...
Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
30 Sep 2016 11:24 PM
Bump
Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
01 Oct 2016 12:29 AM
Bump PLZ
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
01 Oct 2016 02:16 AM
message('Time To Start The Game!',5)

for i,v in next, game.Players:GetPlayers() do
if v.Team == game.Teams.Away then
v.Character.Torso.CFrame = workspace.AwaySpawn.CFrame
elseif v.Team == game.Teams.Home then
v.Character.Torso.CFrame = workspace.HomeSpawn.CFrame
end
end

wait(7)
message('Here Are This Matchups Teams!',5)
wait(7)
message(away.Name..' Is Your Away Team!',5)
workspace.awayroom.door.CanCollide = false
workspace.awayroom.door.Transparency = 1
wait(10)
workspace.awayroom.door.CanCollide = true
workspace.awayroom.door.Transparency = 0
wait(5)
message("Here Are Your "..home.Name,5)
workspace.homeroom.door.CanCollide = false
workspace.homeroom.door.Transparency = 1
wait(10)
workspace.homeroom.door.CanCollide = true
workspace.homeroom.door.Transparency = 0


Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
02 Oct 2016 12:49 PM
Don't you have to have a cFrame.New?
Report Abuse
OldGoldie is not online. OldGoldie
Joined: 17 Aug 2010
Total Posts: 8210
02 Oct 2016 12:51 PM
No,
the CFrame value inside Parts basically are CFrame.new(the position)


Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
02 Oct 2016 12:54 PM
And btw it still doesn't teleport everyone...
Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
02 Oct 2016 12:56 PM
My code:

message("Time To Start The Game!",5);
wait(7)
game.Workspace.stadiummus:Play()
for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor==away.TeamColor then
v.Character.Torso.CFrame = workspace.awaytele.CFrame
wait(1)
for i,v in pairs(game.Players:GetChildren()) do
if v.TeamColor==home.TeamColor then
v.Character.Torso.CFrame = workspace.hometele.CFrame
wait(7)
message("Here Are This Matchup's Teams!",5)
wait(7)
message((away.Name).." Is Your Away Team!",5);
game.Workspace.awayroom.door.CanCollide = false
game.Workspace.awayroom.door.Transparency = 1
wait(10)
game.Workspace.awayroom.door.CanCollide = true
game.Workspace.awayroom.door.Transparency = 0
wait(5)
message("AND NOW",5);
wait(7)
message("Here Are Your "..home.Name,5);
game.Workspace.homeroom.door.CanCollide = false
game.Workspace.homeroom.door.Transparency = 1
################################################################################################################################################################################
Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
02 Oct 2016 01:22 PM
Bump
Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
02 Oct 2016 02:08 PM
bump
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
02 Oct 2016 02:28 PM
LEARN HOW TO DEBUG YOUR CODE.

MY CODE WORKS FINE


Report Abuse
DevDays is not online. DevDays
Joined: 16 Dec 2015
Total Posts: 112
02 Oct 2016 02:32 PM
@TimeTicks Chill.

@PennslyvaniaRoadGeek Make sure all players are in a team, secondly.

Don't put this inside the loop:
v.Character.Torso.CFrame=CFrame.new(-92.308, 1.049, 361.391)
wait(7)
message("Here Are This Matchup's Teams!",5)
wait(7)
...




kappa
Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
02 Oct 2016 02:36 PM
@Ticks

Bro... This is my version of football legends... There are 32 teams and the game picks out 2 of them random... so I can't just name a team thats why there is a value of home and away... the teams are in lighting and the master script has over 1000 lines of code...
Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
02 Oct 2016 02:38 PM
@Dev how will it work if its not in the loop...
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
02 Oct 2016 02:41 PM
Then change it to teamcolor. It doesnt matter!!! Yuo can still use my code


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
02 Oct 2016 02:44 PM
Then change it to teamcolor. It doesnt matter!!! You can still use my code


Report Abuse
DevDays is not online. DevDays
Joined: 16 Dec 2015
Total Posts: 112
02 Oct 2016 02:45 PM
Firstly, your code is really messed up, no offence.

First error, using changing the torso CFrame is a bad idea, you should be using the head/primaryPart.

You can use:
1. v.Character:SetPrimaryPartCFrame(CFrameValue)
2. v.Character:MoveTo(Vector3Value)

Second Error(probably the one you are struggling to remove), The loop IS SLOWED when it finds a player which is in "home" team.

Which means, it has to execute the whole script before returning to the loop.
For this reason, i suggest you to use coroutines.


kappa
Report Abuse
imtellingmommy is not online. imtellingmommy
Joined: 10 Mar 2013
Total Posts: 817
02 Oct 2016 02:46 PM
can u not totally freak out for a guy not liking ur code
u guys are such sore losers
Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
02 Oct 2016 02:59 PM
Your "Code" doesn't work...
Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
02 Oct 2016 03:00 PM
^ @ticks
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
02 Oct 2016 03:02 PM
ffs all u have to do is change a couple of lines. Maybe you need to lean how to debug for once.

message('Time To Start The Game!',5)

for i,v in next, game.Players:GetPlayers() do
if v.TeamColor == game.Teams.away.TeamColor then
v.Character.Torso.CFrame = CFrame.new(92.212,1.001,-49.616)
elseif v.Team == game.Teams.home.TeamColor then
v.Character.Torso.CFrame = CFrame.new(-92.308,1.049,361.391)
end
end

wait(7)
message('Here Are This Matchups Teams!',5)
wait(7)
message(away.Name..' Is Your Away Team!',5)
workspace.awayroom.door.CanCollide = false
workspace.awayroom.door.Transparency = 1
wait(10)
workspace.awayroom.door.CanCollide = true
workspace.awayroom.door.Transparency = 0
wait(5)
message("Here Are Your "..home.Name,5)
workspace.homeroom.door.CanCollide = false
workspace.homeroom.door.Transparency = 1
wait(10)
workspace.homeroom.door.CanCollide = true


Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
02 Oct 2016 03:04 PM
I DID THAT IT DIDN'T WORK
Report Abuse
PennslyvaniaRoadGeek is not online. PennslyvaniaRoadGeek
Joined: 06 Jan 2012
Total Posts: 404
02 Oct 2016 03:05 PM
THE TEAMS AREN'T CALLED AWAY AND HOME...
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
02 Oct 2016 03:07 PM
OMG I MEANT

if v.TeamColor == away.TeamColor then




Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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