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: Announcement Gui.

Previous Thread :: Next Thread 
Xaerium is not online. Xaerium
Joined: 25 Apr 2009
Total Posts: 126
17 May 2015 05:02 PM
Hi, I made a module script that makes an announcement for every player in the game, but I have a problem, it is supposed to do it for all players at the same time, but what it does is do it on 1 player and waits for it to be finished and then does it for the other player, not all at the same time, I know my issue is that I do the for loop for every player and then the for loop for the announcement, but what can I do instead?

function Announcement(Title,LoadTime)
for _,v in pairs (game.Players:GetPlayers())do
if LoadTime ~= nil then
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[]")
v.PlayerGui.NotificationGui.Announcement.Visible = true
for i = 1,LoadTime do
wait(1)
i = 1+1
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[.]")
wait(1)
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[..]")
wait(1)
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[...]")
wait(1)
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[]")
end
else
v.PlayerGui.NotificationGui.Announcement.Text.Text = Title
v.PlayerGui.NotificationGui.Announcement.Visible = true
wait(5)
end
v.PlayerGui.NotificationGui.Announcement.Visible = false
end
end
return Announcement
Report Abuse
loweras is not online. loweras
Joined: 20 Feb 2015
Total Posts: 39
17 May 2015 05:03 PM
Im guessing you have it as a startergui?
Report Abuse
Xaerium is not online. Xaerium
Joined: 25 Apr 2009
Total Posts: 126
17 May 2015 05:22 PM
Correct, but if it was a startergui, I would have to reset them every time?
Report Abuse
Xaerium is not online. Xaerium
Joined: 25 Apr 2009
Total Posts: 126
17 May 2015 05:23 PM
Yes, it is a startergui, but if I edit the startergui, wouldnt I have to reset them every time so that they can see it?
Report Abuse
LittleSwift8 is not online. LittleSwift8
Joined: 27 Feb 2013
Total Posts: 348
17 May 2015 05:26 PM
What is this For?
Saying updates?
Raids?
Report Abuse
loweras is not online. loweras
Joined: 20 Feb 2015
Total Posts: 39
17 May 2015 05:30 PM
If it's a startergui when the player joins it will show them the guide, it won't show at the same time unless all the players join at the same time, which would be very, very doubtful.
Report Abuse
loweras is not online. loweras
Joined: 20 Feb 2015
Total Posts: 39
17 May 2015 05:33 PM
I'd suggest adding a time to wait at the top of the script, and change the script into a real script, and take it out of the startergui, if that doesn't work I'll try to fix it.
Report Abuse
Xaerium is not online. Xaerium
Joined: 25 Apr 2009
Total Posts: 126
17 May 2015 05:56 PM
This is a module script used in a round-based game, so it gives some announcements during the game.
Report Abuse
LegitimatlyMe is not online. LegitimatlyMe
Joined: 30 Oct 2013
Total Posts: 1108
17 May 2015 07:01 PM
it's because the player has to finish before the loop can move onto the next player.
Report Abuse
Xaerium is not online. Xaerium
Joined: 25 Apr 2009
Total Posts: 126
18 May 2015 07:26 PM
And how can I make it work properly?
Report Abuse
Xaerium is not online. Xaerium
Joined: 25 Apr 2009
Total Posts: 126
22 May 2015 06:21 PM
Bump
Report Abuse
Xaerium is not online. Xaerium
Joined: 25 Apr 2009
Total Posts: 126
22 May 2015 07:59 PM
Bump
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
22 May 2015 08:10 PM
like the othe rguy said, it has to finish dealing with one player before moving on to the next.

swap them around. for example, instead of this:

for i,v in pairs(game.Players:GetChildren()) do
for z=1, 2 do
-daaaa
wait(1)
end
end

do this:

for i=1, 2 do
for z,c in pairs(game.Players:GetChildren()) do
-daaaa
end
end



for _,v in pairs (game.Players:GetPlayers())do
if LoadTime ~= nil then
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[]")
v.PlayerGui.NotificationGui.Announcement.Visible = true
for i = 1,LoadTime do
wait(1)
i = 1+1
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[.]")
wait(1)
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[..]")
wait(1)
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[...]")
wait(1)
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[]")
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
22 May 2015 08:10 PM
oops, the code at the bottom was just for me to see your post
Report Abuse
Xaerium is not online. Xaerium
Joined: 25 Apr 2009
Total Posts: 126
22 May 2015 08:40 PM
I don't understand
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
22 May 2015 09:00 PM
for i,v in pairs(game.Players:GetChildren()) do
--stuff
wait(2)
-stuff
end

in this code, when it loops through all the players, it waits for a total of 2 seconds. the script is yielded for 2 seconds - only after those 2 secodns are passed does it move onto the other player

do this:

for i=1, 2 do
for z,c in pairs(game.Players:GetChildren()) do
-stuff
end
wait(1)
end

instead of putting the wait INSIDE the player, we use a for loop - inside that for loop, we cycle through the players

makes sense?

Report Abuse
Xaerium is not online. Xaerium
Joined: 25 Apr 2009
Total Posts: 126
22 May 2015 09:04 PM
Yes, but if inside of that I put this:
wait(1)
i = 1+1
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[.]")
wait(1)
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[..]")
wait(1)
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[...]")
wait(1)
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[]")

it will still need to wait in-order for the player loop to be finished.
Report Abuse
DarthStrantax is not online. DarthStrantax
Joined: 31 May 2011
Total Posts: 2610
22 May 2015 09:06 PM
function Announcement(Title,LoadTime)
for _,v in pairs (game.Players:GetPlayers())do
coroutine.resume(coroutine.create(function()
if LoadTime ~= nil then
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[]")
v.PlayerGui.NotificationGui.Announcement.Visible = true
for i = 1,LoadTime do
wait(1)
i = 1+1
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[.]")
wait(1)
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[..]")
wait(1)
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[...]")
wait(1)
v.PlayerGui.NotificationGui.Announcement.Text.Text = (Title.."[]")
end
else
v.PlayerGui.NotificationGui.Announcement.Text.Text = Title
v.PlayerGui.NotificationGui.Announcement.Visible = true
wait(5)
end
v.PlayerGui.NotificationGui.Announcement.Visible = false
end))
end
end
return Announcement
Report Abuse
LongKillKreations is not online. LongKillKreations
Joined: 14 Feb 2014
Total Posts: 4502
22 May 2015 09:10 PM
my god you really don't understand

just use that guy's script
Report Abuse
Xaerium is not online. Xaerium
Joined: 25 Apr 2009
Total Posts: 126
22 May 2015 09:19 PM
Ok thanks all of you!
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