|
| 27 Apr 2013 01:02 PM |
I have this
while true do if script.Parent.Humanoid.Health = 0 then script.Parent.Head.Anchored = false wait(0.1) BOOM = Instance.new("Explosion") BOOM.Parent = script.Parent.Head end
What i want it to do is if the models humanoid = 0 then to make an explosion where the head is somone help please? |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
| |
|
|
| 27 Apr 2013 01:52 PM |
while true do if script.Parent.Humanoid.Health == 0 then script.Parent.Head.Anchored = false wait(0.1) BOOM = Instance.new("Explosion") BOOM.Parent = script.Parent.Head end end
You left out an end, and the health part has to have 2 equal sign. Try the wiki.
-= Holy mother of monkey milk! =- |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 01:56 PM |
script.Parent.Humanoid.Died:connect(function() local Head = script.Parent:FindFirstChild("Head") local BOOM = Instance.new("Explosion") if Head then BOOM.Position = Head.Position BOOM.Parent = Head Head.Anchored = false end end) |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 02:37 PM |
| It didnt work D; i guess its unfixable ): |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 02:44 PM |
| Somone please help me ;DDDDDDDDDD |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 02:47 PM |
a == true while a == true do if script.Parent.Humanoid.Health == 0 then a = false script.Parent.Head.Anchored = false wait(0.1) BOOM = Instance.new("Explosion") BOOM.Parent = script.Parent.Head end end |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 02:48 PM |
woops wrong variable
a = true while a == true do if script.Parent.Humanoid.Health == 0 then a = false script.Parent.Head.Anchored = false wait(0.1) BOOM = Instance.new("Explosion") BOOM.Parent = script.Parent.Head end end |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 02:53 PM |
Jammin My game crashed D:
I want it so the explosion ONLY comes when the models health is at 0 |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 02:54 PM |
You used the 2nd script? :( |
|
|
| Report Abuse |
|
|
| |
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 27 Apr 2013 03:00 PM |
I AM GETTING SCARED!
Why, why, why... You lag your games with infinite loops, mix up == and = ect. ): Sorry if I'm kinda harsh, but I see too many of these nowadays... x_x
By the way, why shouldn't notsopwnedg's solution work? Haven't tested it, but I don't see anything wrong with it (unless you put the script OUTSIDE the Player's Character<<<)
- As, mommy, SH is scaring ): |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 03:02 PM |
Ok it is not a person Its in a model With a one brick things called head and the humanoid is in the model and so is the script would this make it a problem? |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 27 Apr 2013 03:04 PM |
No, I just think that Humanoids are mostly used in Player characters (or AIs, but then I have to be informed :/)
- As, omnom22. |
|
|
| Report Abuse |
|
|
| |
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 27 Apr 2013 04:04 PM |
I believe that notsopwnedg's solution should work. But the other stuff seems to be buggish.
- As, speak to Outputbot. |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 05:37 PM |
| Doesnot work i guess it is not posible |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 27 Apr 2013 05:48 PM |
Everything is possible.
^ That's what I think.
:3
- As, it's possible to hax life too. |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 05:52 PM |
| Sooo how come this wont work! |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 27 Apr 2013 05:56 PM |
Okay, let's take a look on his code: ------------------------------------------------- script.Parent.Humanoid.Died:connect(function() local Head = script.Parent:FindFirstChild("Head") local BOOM = Instance.new("Explosion") if Head then BOOM.Position = Head.Position BOOM.Parent = Head Head.Anchored = false end end) -------------------------------------------------
I have a few questions: - Where is the script located? - Does the Head get removed upon death?
Now, try add in checks, like this: ------------------------------------------------- script.Parent.Humanoid.Died:connect(function() print("Died") local Head = script.Parent:FindFirstChild("Head") local BOOM = Instance.new("Explosion") print("Head:",Head) if Head then BOOM.Position = Head.Position BOOM.Parent = Head Head.Anchored = false end end) print("Loaded script") -------------------------------------------------
Then, tell me what your output window says, so we can locate the problem!
- As, there's a wiki page for how to read an error. |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 06:00 PM |
This should work...
script.Parent.Humanoid.Died:connect(function() BOOM = Instance.new("Explosion") BOOM.Position = script.Parent.Head.Position BOOM.Parent = game.Workspace end) |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 06:58 PM |
| All it said when i first started was Loaded Script ): |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 27 Apr 2013 07:00 PM |
Okay, so either you never killed the Humanoid, or... yeah, dunno what the problem then could be.
Try kill it, and look for red text in your output. Oh yeah, and still the "Died" print<
- As, keep me bored pliz. |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2013 07:01 PM |
| Nope, and died you mean by killing it with a weapon or changeing its humanoid to 0? |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 27 Apr 2013 07:32 PM |
Whatever makes the health bar go to 0.
Hm, it's weird that the .Died event didn't trigger. Can you send me the model?
- As, lol, just looked at the... new stamper tool? o_o I guess I'm late. |
|
|
| Report Abuse |
|
|