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
 

Re: Help? Why is there an output here??

Previous Thread :: Next Thread 
Jatl8sAlternate is not online. Jatl8sAlternate
Joined: 04 Oct 2012
Total Posts: 250
20 Oct 2012 01:47 PM
=== Script: [ Remove ]===

while true do
wait(5)
if script.Parent.Humanoid.Health<1 then
script.Parent:remove()
end
end


=== Output ===

13:35:36 - Workspace.Zombie.[ Remove ]:3: attempt to index field 'Parent' (a nil value)
13:35:36 - Script "Workspace.Zombie.[ Remove ]", Line 3
13:35:36 - stack end

=== Problem ===

Script works fine. It's doing everything it's supposed to do. After 5 seconds this output comes up.

Can anyone explain what's happening? The script is working fine it's just that this output keeps coming up. Since I am stating a fresh game I would like my game process to be flawless. Thanks!
Report Abuse
Jatl8sAlternate is not online. Jatl8sAlternate
Joined: 04 Oct 2012
Total Posts: 250
20 Oct 2012 01:51 PM
Starting*

This script is supposed to remove the zombie without respawning.
Report Abuse
Jatl8sAlternate is not online. Jatl8sAlternate
Joined: 04 Oct 2012
Total Posts: 250
20 Oct 2012 01:55 PM
Hmm?
Report Abuse
Jatl8sAlternate is not online. Jatl8sAlternate
Joined: 04 Oct 2012
Total Posts: 250
20 Oct 2012 02:03 PM
There's not a problem with the script since it does what its supposed to do
Report Abuse
ObsessedwithMario is not online. ObsessedwithMario
Joined: 03 Mar 2012
Total Posts: 268
20 Oct 2012 02:05 PM
Instead of > 1 use,

if script.Parent.Humanoid.Health ~= nil then

nil = 0
~= not equal to

Hope this helps!
Report Abuse
Jatl8sAlternate is not online. Jatl8sAlternate
Joined: 04 Oct 2012
Total Posts: 250
20 Oct 2012 02:08 PM
I don't think it helps since you are saying there is:

If Health is not equal to 0, remove it.

So whenever the zombie has like 50 health it removes it.

So it's not really going to help.

Thank you though! :D
Report Abuse
Jatl8sAlternate is not online. Jatl8sAlternate
Joined: 04 Oct 2012
Total Posts: 250
20 Oct 2012 02:13 PM
Hmm, this is weird. Nothing is supposed to come out.
Report Abuse
ObsessedwithMario is not online. ObsessedwithMario
Joined: 03 Mar 2012
Total Posts: 268
20 Oct 2012 02:18 PM
Try,

if script.Parent.Humanoid.Health =< 1 then
Report Abuse
Jatl8sAlternate is not online. Jatl8sAlternate
Joined: 04 Oct 2012
Total Posts: 250
20 Oct 2012 02:27 PM
Hmm but I don't think the problem is located there. The script works! I would like to know why is there an output coming out and how to fix this.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
20 Oct 2012 02:31 PM
Try this:

script.Parent.Humanoid.Died:connect(function()
script.Parent:Destroy()
end)
Report Abuse
TheColorMan is not online. TheColorMan
Joined: 30 Jan 2010
Total Posts: 11228
20 Oct 2012 02:33 PM
:remove() to changed into :Destroy() for some reason btw
Report Abuse
Jatl8sAlternate is not online. Jatl8sAlternate
Joined: 04 Oct 2012
Total Posts: 250
20 Oct 2012 02:39 PM
Thanks! Let me try it out. I'll get back to you with the results.
Report Abuse
Jatl8sAlternate is not online. Jatl8sAlternate
Joined: 04 Oct 2012
Total Posts: 250
20 Oct 2012 02:56 PM
@TheDeath

Thank you so much your solution worked!! :D! Thank you!

@TheColor

It did work but the output kept appearing.

Thank you guys! :D
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