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: Help

Previous Thread :: Next Thread 
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
03 Sep 2013 04:02 PM
I have a disaster type game, and I need it to go like this.
Servers begins > wait(30) teleport all players to first voting booth > disasters > lobby >
wait(30) teleport all players to voting booth #2
Problem: It teleports to the first voting booth, but never goes to the second voting booth after they come back from the first disasters.

I made two scripts that I want to try to loop the teleporting with,
Script #1:

db = false

while wait() do
if db == false then
db = true
if game.Workspace.Rounds.Value == 0 then
local Pos = Vector3.new(-133.659, 60.293, -248.462)
wait(30)
for _,v in next, game.Players:GetPlayers() do
if v.Character then
v.Character:MoveTo(Pos);
wait(300)
db = false
end
end
end

Script #2:
db = false

while wait() do
if db == false then
db = true
if game.Workspace.Rounds.Value == 1 then
local Pos2 = Vector3.new(-102.843, 10.099, 187.896)
wait(30)
for _,v in next, game.Players:GetPlayers() do
if v.Character then
v.Character:MoveTo(Pos2);
wait(300)
db = false
end
end
end

Please help, this is one of the core scripts I need for my game.
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
03 Sep 2013 04:07 PM
Nothing in output.
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
03 Sep 2013 04:17 PM
Anyone?
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
03 Sep 2013 04:32 PM
You guys are SO smart and helpful...
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
03 Sep 2013 04:40 PM
Bump
Report Abuse
Exus100 is not online. Exus100
Joined: 11 Aug 2007
Total Posts: 351
03 Sep 2013 04:42 PM
why do you have 2 scripts?
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
03 Sep 2013 04:43 PM
Because I tried writing it all in one, and I tried EVERYTHING else, so I tried splitting up, still doesnt work.
Report Abuse
Exus100 is not online. Exus100
Joined: 11 Aug 2007
Total Posts: 351
03 Sep 2013 04:44 PM
when does the rounds.Value increase?
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
03 Sep 2013 04:45 PM
Right after the first disasters is done.
Report Abuse
Exus100 is not online. Exus100
Joined: 11 Aug 2007
Total Posts: 351
03 Sep 2013 04:47 PM
and whats with the wait(300)?
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
03 Sep 2013 04:49 PM
Thats just try to to make it wait so it doesnt teleport everyone again until the rounds value changes.
Report Abuse
Exus100 is not online. Exus100
Joined: 11 Aug 2007
Total Posts: 351
03 Sep 2013 04:55 PM
--The only bad about this script is that it will teleport the players after 30 seconds everytime the rounds.Value is changed
function teleportPlayers(pos)
for _,v in pairs(game.Players:GetPlayers()) do
if v.Character then
v.Character:MoveTo(pos);
end
end
end

function roundChanged(val)
wait(30);
if (val == 0) then
teleportPlayers(Vector3.new(-133.659, 60.293, -248.462))
elseif (val == 1) then
teleportPlayers(Vector3.new(-102.843, 10.099, 187.896))
end
end

game.Workspace.Rounds.Changed:connect(roundChanged);
Report Abuse
Exus100 is not online. Exus100
Joined: 11 Aug 2007
Total Posts: 351
03 Sep 2013 04:56 PM
and add
roundChanged(0);
to the end of it
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
03 Sep 2013 05:04 PM
I forgot all about the "Changed" event, thanks.
Btw your script doesnt really work, but it gave me an idea for another script.
Report Abuse
tummey2 is not online. tummey2
Joined: 04 Feb 2009
Total Posts: 1802
03 Sep 2013 05:15 PM
Try CFraming the player's Torso?
Report Abuse
BlueBlood12 is not online. BlueBlood12
Joined: 07 Jul 2011
Total Posts: 1377
03 Sep 2013 05:16 PM
Thats not the problem tummey.
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