|
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
|
|
|
|
|
|
VuvaJoin Date: 2010-01-22 Post Count: 1102 |
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 :> |
|
|
crouton04Join Date: 2010-07-07 Post Count: 6557 |
tl;dr
Too Long;Didn't Read
Shorten or get to the point. |
|
|
but that was the point... and i always make errors when i make big scripts |
|
crouton04Join Date: 2010-07-07 Post Count: 6557 |
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. |
|
|
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 |
|
|
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 |
|
crouton04Join Date: 2010-07-07 Post Count: 6557 |
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 |
|
|