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: why doesnt this whole script work?

Previous Thread :: Next Thread 
4ef is not online. 4ef
Joined: 27 May 2013
Total Posts: 5633
01 May 2015 10:20 PM

local gui = game.StarterGui.GameGui.Frame.TextLabel.Text
local s = game.Workspace.Sounds
local maps = game.ServerStorage.Maps
local weapons = game.ServerStorage.Weapons
local spawn = game.ServerStorage.SpawnLocations
local player = game.Players:GetPlayers()
intermission = 30
play = 300

while true do
for i = 1, #player do
local r = (math.random(1,4))
for intermission = 30, 1, -1 do
gui = "Intermission: " ..intermission
end

if r == 1 then
wait()
gui = "Starting New Round"
wait(3)
gui = "Choosing Game"
wait(3)
gui = "Game Type: Free For All Deathmatch Game Map: Free For All Regular"
wait(5)
gui = "Get Ready!"
s.AFKSound:Play()
wait(5)
s.AFKSound:Stop()
wait(1)
maps.FFA:clone().Parent = game.Workspace
wait(1)
game.SpawnLocations:remove()
player[i].Character:MoveTo(Vector3.new(-37,4.2, -479))
wait()
weapons.HL:clone().Parent = player.Backpack
for play = 300, 1, -1 do
gui = "Time Remaining: " ..intermission
end
spawn:clone().Parent = game.Workspace
wait(1)
gui = "Game Over"
wait()
player[i].Character.Humanoid:UnequipTools()
player[i].Backpack:ClearAllChildren()
wait(5)
game.Workspace.FFA:remove()
player[i]:LoadCharacter()
gui = " "
end

end
end


4ef, 3ef, 5ef. Doesn't matter to me!
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
01 May 2015 10:22 PM
r!==1 and the loop crashes
Report Abuse
4ef is not online. 4ef
Joined: 27 May 2013
Total Posts: 5633
01 May 2015 10:25 PM
how do i fix?

4ef, 3ef, 5ef. Doesn't matter to me!
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
01 May 2015 10:27 PM
while wait() do
Report Abuse
4ef is not online. 4ef
Joined: 27 May 2013
Total Posts: 5633
01 May 2015 10:29 PM
what?
just replace it "r == 1 then"?

4ef, 3ef, 5ef. Doesn't matter to me!
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
01 May 2015 10:32 PM
"while true do"
>while wait() do
Report Abuse
4ef is not online. 4ef
Joined: 27 May 2013
Total Posts: 5633
01 May 2015 10:39 PM
doesnt work

4ef, 3ef, 5ef. Doesn't matter to me!
Report Abuse
4ef is not online. 4ef
Joined: 27 May 2013
Total Posts: 5633
01 May 2015 10:55 PM
bump

4ef, 3ef, 5ef. Doesn't matter to me!
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
01 May 2015 11:05 PM
while wait() do
--rest of code
end


Also, use

for i,v in pairs(game.Players:GetChildren()) do
v.Character:MoveTo(Vector3.new(-37,4.2, -479))
end

instead of for i = 1, #player do

Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
01 May 2015 11:31 PM
^ No, numerical for loops are fine and faster anyways.
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