|
| 29 Sep 2012 02:06 AM |
Hey there! I've recently been working on a high-tech Hunger Games game, that basically works on a GUI base. I am here to talk about Coroutines... Just to get things straight, I have no idea how to use them. Infact I tried to incorporate it into my message script in order to get it to project to all the players. I can't figure out how though. Please help me. What this script will do is it will play all the sounds at once and it wont show a single message.
function msg(text, time, typespeed) local msgcreate = coroutine.wrap(function() tick:Play() pl = game.Players:GetChildren() for i = 1,#pl do s = Instance.new("ScreenGui") s.Parent = pl[i].PlayerGui s.Name = "Message" f = Instance.new("Frame") f.Parent = s f.BackgroundTransparency = 1 f.Size = UDim2.new(0.5, 0, 0.04,0) f.Position = UDim2.new(0.25, 0, 0.05, 0) f.BackgroundColor3 = Color3.new(0,0,0) f.BorderSizePixel = 0 txt = Instance.new("TextLabel") txt.Parent = f txt.FontSize = 6 txt.Font = "ArialBold" txt.TextColor3= Color3.new(1,1,1) txt.Position = UDim2.new(0.5, 0, 0.5, 0) txt.TextTransparency = 0 txt.Text = "" for u = 1,0,-0.1 do wait() f.BackgroundTransparency = u txt.TextTransparency = u end for i = 1,string.len(text),1 do txt.Text = string.sub(text,1,i) wait(typespeed) end wait(time) for u = 0,1,0.1 do wait() f.BackgroundTransparency = u txt.TextTransparency = u end s:remove() end msgcreate() end) end
How would I project the announce gui to all the players? Thanks! ToontownROXYA. |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Sep 2012 02:14 AM |
I need help on making it show on all of the players screens, technically.
~Wow, all ROBLOXians are smart! Until I met Bob... Bob : ~:3 Whart? |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 02:15 AM |
for _,v in pairs(game.Players:GetPlayers()) do v.PlayerGui.PATHTHINGHERE end |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 02:19 AM |
| Thats exactly the same as the for loop. |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 02:20 AM |
| Sorry, didn't read it right. That wouldn't work? Any output? |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 02:22 AM |
| Lol it would the _v would work. Just its exactly the same lol. Nope no output. It just wont show to all the players at once. It shows to one player, then the next, the next, and so forth until all the players have seen it. |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 02:23 AM |
| Forget about the msgcreate() and the coroutine.wrap(function() |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 02:31 AM |
| I want it to show allllll at ONE time. |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 02:36 AM |
put it in workspace wait however long clone it and delete
novice :P |
|
|
| Report Abuse |
|
|
| |
|
Aerideyn
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 1882 |
|
|
| 29 Sep 2012 02:37 AM |
| coroutine.resume(coroutine.create(yourfunctionhere,variable1,variable2,...)) |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 02:38 AM |
Gui = game.Lighting.Gui:Clone() Gui.Parent = Game.Workspace |
|
|
| Report Abuse |
|
|