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 
DiePizzaX is not online. DiePizzaX
Joined: 06 Dec 2012
Total Posts: 9
06 Jul 2014 04:10 PM
When the script runs it runs fine.. but when it does teleporting it only teleports one person (the first person that joined) Help??

SCRIPT :












while wait(10) do
function StartGame()

for i, v in pairs(game.Players:GetChildren()) do
local Info = v.PlayerGui.Information
local BeepSoundId = 161164363
local getplayers = game.Players:GetChildren()
local Beep = Instance.new("Sound", v.PlayerGui)
Beep.Volume = 1
Beep.SoundId = "http://www.roblox.com/asset?id="..BeepSoundId..""
local ZombiesAlive = game.Workspace.ZombiesAlive
local Round = 0

local BattleMusicId = 151514610
local BattleMusic = Instance.new("Sound", v.PlayerGui)
BattleMusic.Name = "BattleMusic"
Beep.Name = "Beep"
BattleMusic.Volume = 1
BattleMusic.SoundId = "http://www.roblox.com/asset?id="..BattleMusicId..""
local InfoText = Info.Frame.TextLabel
game.Workspace.PlayersAlive.Value = #getplayers
local script = script.Check
script:Clone().Parent = v.Character
v.Character.Check.Disabled = false
game.Workspace.Teleport.Disabled = false
wait(1)
game.Workspace.Teleport.Disabled = true
Beep:Play()
InfoText.Text = "Oh, look another survivor!"
wait(3)
Beep:Play()
InfoText.Text = "Look, I am glad you are alive!"
wait(3)
Beep:Play()
InfoText.Text = "But I seriously need help right now!"
wait(3)
Beep:Play()
InfoText.Text = "But, right now I am trapped in Jeff The Killer's Prison!"
wait(3)
Beep:Play()
InfoText.Text = "I need your help to get me out of here!"
wait(3)
Beep:Play()
InfoText.Text = "You better watch out because he has some minions!"
wait(3)
Beep:Play()
InfoText.Text = "That's all the information I can give you, he's coming to my cell!"
wait(3)
InfoText.Text = ""
BattleMusic:Play()
wait()
Round = 1
local round1zombies = game.Lighting.Round1:GetChildren()
for i,v in pairs(game.Lighting.Round1:GetChildren()) do
v:Clone().Parent = game.Workspace

end
ZombiesAlive.Value = #round1zombies
repeat
print("waiting..")
wait(1)
until game.Workspace.ZombiesAlive.Value == 0
BattleMusic:Stop()
Beep:Play()
InfoText.Text = "Defeated the minions? Great!"
wait(3)
Beep:Play()
InfoText.Text = "You may now proceed on into the caves!"
wait(3)
InfoText.Text = ""
game.Workspace.Blockers.Round2.CanCollide = false
Beep:Play()
InfoText.Text = "Alright, caves are a little more dangerous.."
wait(3)
Beep:Play()
InfoText.Text = "There is a high chance that a ton of zombies can spawn..."
wait(3)
Beep:Play()
InfoText.Text = "But from what I remembered there was not many."
InfoText.Text = ""
wait(3)
BattleMusic:Play()
local round2zombies = game.Lighting.Round2:GetChildren()
for i,v in pairs(game.Lighting.Round2:GetChildren()) do
v:Clone().Parent = game.Workspace
end
ZombiesAlive.Value = #round2zombies
repeat
print("waiting..")
wait(1)
until game.Workspace.ZombiesAlive.Value == 0
wait(1)
BattleMusic:Stop()
Beep:Play()
InfoText.Text = "Great job!"
wait(3)
Beep:Play()
InfoText.Text = "Everything is going well so far"
wait(3)
Beep:Play()
InfoText.Text = "But still no where close to saving me..."
wait(3)
Beep:Play()
InfoText.Text = "Proceed on to exit the caves"
wait(3)
InfoText.Text = ""
wait(10)
Beep:Play()
InfoText.Text = "Hmm.. I am detecting some minions on my radar.."
wait(3)
Beep:Play()
InfoText.Text = "Stay alert."
wait(2.8)
InfoText.Text = ""
game.Workspace.Blockers.Round3Start.CanCollide = false
wait(5)
wait(3)
Beep:Play()
InfoText.Text = "Yep, I was correct... MINIONS!!"
wait(3)
InfoText.Text = ""
BattleMusic:Play()
local round3zombies = game.Lighting.Round3:GetChildren()
for i,v in pairs(game.Lighting.Round3:GetChildren()) do
v:Clone().Parent = game.Workspace
end
ZombiesAlive.Value = #round3zombies
repeat
print("waiting..")
wait(1)
until game.Workspace.ZombiesAlive.Value == 0
wait(1)
BattleMusic:Stop()
Beep:Play()
InfoText.Text = "Oh, and I forgot to say.."
wait(3)
Beep:Play()
InfoText.Text = "Blue leave bushes can heal you gradually."
wait(3)
Beep:Play()
InfoText.Text = "If you need healing you can touch the middle of it to heal"
wait(3)
Beep:Play()
InfoText.Text = "When your done healing or don't need healing proceed on into the field."
wait(3)






end


end
StartGame()
end

Report Abuse
DiePizzaX is not online. DiePizzaX
Joined: 06 Dec 2012
Total Posts: 9
06 Jul 2014 04:12 PM
Bump.
Report Abuse
DiePizzaX is not online. DiePizzaX
Joined: 06 Dec 2012
Total Posts: 9
06 Jul 2014 05:23 PM
No one knows??
Report Abuse
DiePizzaX is not online. DiePizzaX
Joined: 06 Dec 2012
Total Posts: 9
06 Jul 2014 05:27 PM
Bump!
Report Abuse
DiePizzaX is not online. DiePizzaX
Joined: 06 Dec 2012
Total Posts: 9
06 Jul 2014 05:32 PM
sigh......
Report Abuse
Vuva is not online. Vuva
Joined: 22 Jan 2010
Total Posts: 1102
06 Jul 2014 05:33 PM
I think the problem is that your script is too big and nobody feels like looking for the problem. That's the problem with me anyways :>
Report Abuse
DiePizzaX is not online. DiePizzaX
Joined: 06 Dec 2012
Total Posts: 9
06 Jul 2014 05:52 PM
wow
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
06 Jul 2014 05:55 PM
tl;dr


Too Long;Didn't Read


Shorten or get to the point.
Report Abuse
DiePizzaX is not online. DiePizzaX
Joined: 06 Dec 2012
Total Posts: 9
06 Jul 2014 06:02 PM
but that was the point... and i always make errors when i make big scripts
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
07 Jul 2014 06:33 AM
Use prints with different messages in them to see where the script breaks. Or activate script debugger if you already havent and look for errors that way.
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
07 Jul 2014 06:48 AM
Ok i got it,

the problem is that you have a loop right at the very start,
since you have waits inside your giant loop it is running all that code for the 1st player, then when it is finished it is running all that code for the next player and so on..

what you really want to do is fire the loop for all players simultaneously instead of 1 after the other
Report Abuse
PRESTIGIOUSaLEGEND is not online. PRESTIGIOUSaLEGEND
Joined: 16 Apr 2011
Total Posts: 1765
07 Jul 2014 06:51 AM
Your script has this layout:

loop
code
wait
code
wait
end

To fire all players simultaneously we do:

loop code end
wait
loop code end
wait
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
07 Jul 2014 11:21 AM
What i see is:

while loop
for loop
code
end
end

that shuld work being that the for loop is in while loop

for loop runs dent he while loop runs den the while loop runs when the for loop dun
Report Abuse
DiePizzaX is not online. DiePizzaX
Joined: 06 Dec 2012
Total Posts: 9
09 Jul 2014 08:43 AM
Thanks I understand now
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