|
| 29 Dec 2011 07:45 PM |
Let's say I wanted to make a GUI that detected when a player had died (Their health has reached 0)
1.) Would I need a localscript, or just a script? (I know this may sound like I'm going insane, [which I think I am], but what's the difference between the two?)
2.) I'm a strong enforcer of the rule "No requests" myself, but could someone at least give me the backbone of what I need to do? I tried already, but output didn't display anything about it, as if nothing were wrong, but the script didn't work. Here it is.
game.Players:GetChildren(function(plrs) while true do for i = 1, #plrs do if plrs[i].Humanoid.Health = 0 then script.Parent.Frame.TextLabel.Text = "Someone has died!" end end end end)
-- I plan on adding a line that finds the name of the dead player, and displays it, but I want to get this part working first.
If you can help, great. If you can't, gobiey. ;] |
|
|
| Report Abuse |
|
|
| 29 Dec 2011 07:47 PM |
game.Players.PlayerAdded:connect(function(plr) plr.Character.Humanoid.Died:connect(function() script.Parent.Frame.TextLabel.Text = plr.Name.." Has died!" end) end)
R.I.P Ben Breedlove. |
|
|
| Report Abuse |
|
|
| 29 Dec 2011 07:48 PM |
| Thank you so much biker! :] |
|
|
| Report Abuse |
|
|
| 29 Dec 2011 07:51 PM |
| .. Errm.. Not sure why, (Output says nothing? D:) but that's not working... |
|
|
| Report Abuse |
|