|
| 26 May 2013 11:22 AM |
false?
sp = script.Parent
while true do wait() if sp.Parent.Humanoid == true then wait(1) sp.Parent.Parent.Camera.GUI.Battery.Battery_Label.Humanoid.MaxHealth = sp.Parent.Parent.Camera.GUI.Battery.Battery_Label.Humanoid.MaxHealth - 1 elseif sp.Parent.Humanoid ~= true then return end end
output: Humanoid is not a valid member of BackPack |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 11:24 AM |
| is this a Local script? is a tool or hopperbin? where is this script at? |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 11:25 AM |
Connection:
Staterpack -Flashlight --BatteryDrain (The Script) --Normal Script |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 11:27 AM |
| I'm trying to get it so when the player is holding it, the battery looses (and gui goes invisible when the health goes down) health. |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 11:28 AM |
sp = script.Parent
while true do wait() if sp.Parent:FindFirstChild("Humanoid") then--You'd usually compare it with nil wait(1) sp.Parent.Parent.Camera.GUI.Battery.Battery_Label.Humanoid.MaxHealth= sp.Parent.Parent.Camera.GUI.Battery.Battery_Label.Humanoid.MaxHealth - 1 elseif not sp.Parent:FindFirstChild("Humanoid") then return end end |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 11:29 AM |
| Btw, according to output, the script's Parent is backpack o-o |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 11:30 AM |
if sp.Parent:findFirstChild("Humanoid") ~=nil then wait(1) sp.Parent.Parent.Camera.GUI.Battery.Battery_Label.Humanoid.MaxHealth = sp.Parent.Parent.Camera.GUI.Battery.Battery_Label.Humanoid.MaxHealth - 1 else return sp.Parent:findFirstChild("Humanoid")
@ScrewDeath IKR? |
|
|
| Report Abuse |
|
|
|
| 26 May 2013 11:55 AM |
Well theirs no output.. But the health doesn't go down.
I tested it by seeing if my Humanoids Health will go down first, but it didn't. |
|
|
| Report Abuse |
|
|
| |
|