generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

How do I get this script to return, if the connection is f?

Previous Thread :: Next Thread 
NoobOMaticMachine is not online. NoobOMaticMachine
Joined: 26 Oct 2012
Total Posts: 2877
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
vampirexevipex is not online. vampirexevipex
Joined: 11 Apr 2009
Total Posts: 1598
26 May 2013 11:24 AM
is this a Local script? is a tool or hopperbin? where is this script at?
Report Abuse
NoobOMaticMachine is not online. NoobOMaticMachine
Joined: 26 Oct 2012
Total Posts: 2877
26 May 2013 11:25 AM
Connection:

Staterpack
-Flashlight
--BatteryDrain (The Script) --Normal Script
Report Abuse
NoobOMaticMachine is not online. NoobOMaticMachine
Joined: 26 Oct 2012
Total Posts: 2877
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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
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
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
26 May 2013 11:29 AM
Btw, according to output, the script's Parent is backpack o-o
Report Abuse
vampirexevipex is not online. vampirexevipex
Joined: 11 Apr 2009
Total Posts: 1598
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
NoobOMaticMachine is not online. NoobOMaticMachine
Joined: 26 Oct 2012
Total Posts: 2877
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
NoobOMaticMachine is not online. NoobOMaticMachine
Joined: 26 Oct 2012
Total Posts: 2877
26 May 2013 11:55 AM
there's*
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image