miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 04 Sep 2011 10:58 PM |
while wait(598) do local Message = Instance.new("Message", Workspace) for i,v in pairs(game.Players:GetPlayers()) do if v:findFirstChild("leaderstats") then if v.leaderstats["Magma Goals"].Value > v.leaderstats["Squriter Goals"].Value then Message.Text = "Team Magma Wins!" wait(2) Message:Remove() elseif v.leaderstats["Squirter Goals"].Value > v.leaderstats["Magma Goals"].Value then Message.Text = "Team Squirter Wins!" wait(2) Message:Remove() end end end end
I Don't know because when I remove it I think it removes forever :O |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2011 11:02 PM |
it all looks good. Instead of removing the message you could just set the text to "" . then of course in the end you can remove it. Also you may want to add something like
elseif v.leaderstats["Squirter Goals"].Value == v.leaderstats["Magma Goals"].Value then Message.Text = "it was a tie!"
aside from that it all looks good |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 04 Sep 2011 11:04 PM |
Three questions
One, when I say Message:Remove() will it remove it forever so the next round th message won't show up? Two, if I DON'T ADD what you said, would it sill work? Three, are you SURE it works? |
|
|
| Report Abuse |
|
|
tdog158
|
  |
| Joined: 08 Jul 2008 |
| Total Posts: 5413 |
|
|
| 04 Sep 2011 11:09 PM |
| I'm not sure, but I usually use game:GetService("Debris"):AddItem(message,2) instead of wait(2) message:remove() |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 04 Sep 2011 11:14 PM |
@tdog
I wished that mrgamenwatch can anwer my question :O |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2011 11:15 PM |
| once you remove the message the first time you can't change the text of it unless you create a new one. thats the only real problem. i just suggested the if statement for the tie just in case both scores are the same. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 04 Sep 2011 11:16 PM |
"I wished that mrgamenwatch can anwer my question :O"
Why so?
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2011 11:18 PM |
| anybody want to answer my question? http://www.roblox.com/Forum/ShowPost.aspx?PostID=54264129 |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 04 Sep 2011 11:19 PM |
@MrgameNwatch
can I just say Message.Text = "" instead of Message:Remove()
OMG THERE WAS A SPIDER THAT WAS COMING RIGHT AT ME!!IMA KILL IT RIGHT NOW! |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 04 Sep 2011 11:21 PM |
Btw I got the spider :D
I killed it with my dads videos that he loves.
Anyway yeah MrgameNwatch can I just say Message.Text = ""? |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Sep 2011 11:26 PM |
| @miz656 At the beginning of the script you are creating a new message so message:remove() at the end wouldnt be a problem. Although if you want to cause less lag (not noticable probably) you should just change the text instead of adding and removing. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 04 Sep 2011 11:31 PM |
| Ok so I should say Message:Text = "" |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 04 Sep 2011 11:37 PM |
Also, one more thing--Look at bottom while wait(598) do local Message = Instance.new("Message", Workspace) for i,v in pairs(game.Players:GetPlayers()) do if v:findFirstChild("leaderstats") then if v.leaderstats["Magma Goals"].Value > v.leaderstats["Squriter Goals"].Value then Message.Text = "Team Magma Wins!" wait(2) Message:Remove() elseif v.leaderstats["Squirter Goals"].Value > v.leaderstats["Magma Goals"].Value then Message.Text = "Team Squirter Wins!" wait(2) Message:Remove() end end end end for i, v in pairs(game.Players:GetChildren()) if game.Players.NumPlayer =<2 then script.Disabled = false end end
I want it to work if theres 2 or more players on.NOW would it work?
|
|
|
| Report Abuse |
|
|
|
| 04 Sep 2011 11:41 PM |
Players = game.Players:GetPlayers() if #Players < 2 then script.Disabled = true
--You mean that? |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 04 Sep 2011 11:43 PM |
repeat wait() print("Not enough players") until game.Players.NumPlayers=>2 while wait(598) do local Message = Instance.new("Message", Workspace) for i,v in pairs(game.Players:GetPlayers()) do if v:findFirstChild("leaderstats") then if v.leaderstats["Magma Goals"].Value > v.leaderstats["Squriter Goals"].Value then Message.Text = "Team Magma Wins!" wait(2) Message:Remove() elseif v.leaderstats["Squirter Goals"].Value > v.leaderstats["Magma Goals"].Value then Message.Text = "Team Squirter Wins!" wait(2) Message:Remove() end end end end
Sorry, I'm very tired.
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 04 Sep 2011 11:43 PM |
| Ok, but if there is two players online would the script work?Or should I just make a seperate script saying which scripts I want to work and don't work |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 04 Sep 2011 11:47 PM |
@nate
Is it ok if I delete the print function?When you said that it crashed the output |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 04 Sep 2011 11:47 PM |
just make it 1 player to test.
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 04 Sep 2011 11:47 PM |
you can can remove it.
I also suggest you use wait(.5)
<'+1 Post. Ujelly?'> |
|
|
| Report Abuse |
|
|
|
| 04 Sep 2011 11:51 PM |
repeat wait() print("Not enough players") until game.Players.NumPlayers>=2 --small error i fixed
i'm going to bed now. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 04 Sep 2011 11:53 PM |
@nate
It worked, for now...I'll message you if I need help with anything else. |
|
|
| Report Abuse |
|
|