yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 21 Mar 2015 10:16 AM |
| What is the best way to go about making a custom health script(in detail please), I thought it may be to add a value to the players character and then say if it = to 0 they are dead and if hit by a raycast, the ray will use FindFirstChild("HealthValue") and then take 10 from it,, how would i start this? |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2015 10:18 AM |
Well what I would do is use a .Touched function in every part of the character and make a NumberValue named "Health" then I would put a BillBoardGUi on top of the players head and update the size depending on the health. That's how I would do it but you need to figure out the scripts. |
|
|
| Report Abuse |
|
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 21 Mar 2015 10:22 AM |
So maybe like f
local children = game.Player.LocalPlayer foreach child in children do if child == "Part" then child.Touched:connect(function() --SOMETHING LIKE THAT? end end end |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2015 10:23 AM |
| Yeah but you need to attach a BillBoardGui into the players head and you need a lot more scripts |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2015 10:24 AM |
A child/Children is the smaller parts of a parent,
What the hell is that? |
|
|
| Report Abuse |
|
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 21 Mar 2015 10:25 AM |
| Ok, but should ahve mentioned in my game you dont have a player, there character is replaced with a union(a ship)..... How am i going to make this work. I insert the value and say if the part is touched then its value shuld decrease. |
|
|
| Report Abuse |
|
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
| |
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
| |
|
|
| 21 Mar 2015 10:36 AM |
| Why would you need to get when the player is touched? You described what you needed to do perfectly, so just do it. |
|
|
| Report Abuse |
|
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 21 Mar 2015 10:39 AM |
| Oh,did i? but aanyway i am stuuuggling because i want so when the health (numbervalue) gets to 0 it will display a gui on the players screen but i cant do that because tyo access the value you n eed a script but i want to use local scripts so i can access the local player, how do i do this? |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2015 10:45 AM |
| Use a localscript that accesses the value? |
|
|
| Report Abuse |
|
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 21 Mar 2015 10:46 AM |
| I can't seem to get that workign tho, it jsut never finds it |
|
|
| Report Abuse |
|
|
CrowClaws
|
  |
| Joined: 04 Jul 2010 |
| Total Posts: 4466 |
|
|
| 21 Mar 2015 10:46 AM |
local script--
Value.Changed:connect(function() if Value.Value <= 0 then --Show gui end end |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2015 11:15 AM |
| You need to insert the billboardgui in the union. Uncopylock the place and I will fix it |
|
|
| Report Abuse |
|
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 21 Mar 2015 11:18 AM |
| Yeah, nice try i already fixed it, yo aint stealing mah game |
|
|
| Report Abuse |
|
|
|
| 21 Mar 2015 12:11 PM |
| I dont steal games. Its absolutely fine! I understand your concern.VEry nice job fixing it and good luck with your game! |
|
|
| Report Abuse |
|
|