moses747
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 269 |
|
|
| 21 May 2013 08:39 PM |
What would I use for that. Here is my guess: if game.Workspace.Player.Humanoid.Health == 0 then
Is that right or not. If not then what would I use? |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 21 May 2013 08:40 PM |
if game.Workspace.Player.Humanoid.Health <= 1 then
Just in case...
~ The ATR Fishie ~ |
|
|
| Report Abuse |
|
|
moses747
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 269 |
|
| |
|
|
| 21 May 2013 08:50 PM |
| lord's would work. Show us the actual script you're using and the output you're getting. |
|
|
| Report Abuse |
|
|
moses747
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 269 |
|
|
| 21 May 2013 08:51 PM |
local h = Instance.new("Hint", game.Workspace) wait(.1) h.Text = "Welcome! Try to esacpe... if you can." wait(15) h:remove() if game.Workspace.Player.Humanoid.Health <= 1 then wait(.1) h.Text = "Oh no! You were so close! Try again." wait(15) h:remove() end
That is a Local Script. |
|
|
| Report Abuse |
|
|
|
| 21 May 2013 08:54 PM |
| Where is this located? Localscripts don't work in workspace. Your script won't also work as intended to. It'll only check if the a player named "Player" is dead at the exact moment (after 15 secs) |
|
|
| Report Abuse |
|
|
moses747
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 269 |
|
|
| 21 May 2013 09:01 PM |
| Oh, it's in StarterGUI, it works for the first part but not the second part. And how do I put any player in general (any player playing it). |
|
|
| Report Abuse |
|
|
|
| 21 May 2013 09:05 PM |
| game.Players.LocalPlayer.Character.Humanoid.Health |
|
|
| Report Abuse |
|
|
Shapeless
|
  |
| Joined: 18 May 2013 |
| Total Posts: 106 |
|
|
| 21 May 2013 09:12 PM |
Yours is just not practical...
local Players = {} local SetUp = function() for _,n in next,Game.Players:GetPlayers() do table.insert(Players,n) end for _,n in next,Players do if n and n.Character and n.Character:FindFirstChild("Humanoid") then coroutine.wrap(function() n.Character.Humanoid.Died:wait() for __,nn in next,Players do if nn == n then table.remove(Players,__) end end end)() end end end
local IS = function(P) for _,n in next,Players do if P == n then return true end end end
local Added = function(Player) SetUp() local h = Instance.new("Hint", game.Workspace) wait(.1) h.Text = "Welcome! Try to esacpe... if you can." wait(15) h:Destroy() for _,n in next,Game.Players:GetPlayers() do if IS(n) then --------------------What to do when they are alive---------- else ---------------What to do when they are dead------------- end end Players = {} end
|
|
|
| Report Abuse |
|
|
moses747
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 269 |
|
|
| 21 May 2013 09:12 PM |
| It didn't work I will show you the script. I will toy around with it though. |
|
|
| Report Abuse |
|
|
moses747
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 269 |
|
|
| 21 May 2013 09:13 PM |
local h = Instance.new("Hint", game.Workspace) wait(.1) h.Text = "Welcome! Try to escape... if you can." wait(15) h:remove() if game.Players.LocalPlayer.Character.Humanoid.Health <= 1 then wait(.1) h.Text = "Oh no! You were so close! Try again." wait(15) h:remove() end
|
|
|
| Report Abuse |
|
|
Shapeless
|
  |
| Joined: 18 May 2013 |
| Total Posts: 106 |
|
|
| 21 May 2013 09:16 PM |
Thanks, for ignoring me :).
But in this example you already removed the message. So either re-parent it or don't remove it.
local h = Instance.new("Hint", game.Workspace) wait(.1) h.Text = "Welcome! Try to escape... if you can." wait(15) h:remove()
if game.Players.LocalPlayer.Character.Humanoid.Health <= 1 then wait(.1) h.Text = "Oh no! You were so close! Try again." h.Parent = Worksapce wait(15) h:remove() end
|
|
|
| Report Abuse |
|
|
|
| 21 May 2013 09:17 PM |
If this is in StarterGUI and everyone is recieving the GUI; can't you simply do:
if script.Parent.Parent.Parent.Character.Humanoid.Health <= 1 then
Assuming it's directly under a ScreenGUI. |
|
|
| Report Abuse |
|
|