KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 02 Sep 2013 11:48 AM |
I want to make a script that when the health is down to 0 then an explosion would come out of the torso... this is what i did:
if script.Parent.Humanoid.Health = 0 then local e = Instance.new("Explosion",Guy) e.Position = workspace.Guy.Torso.Position.Value end
output says: Workspace.NakedGuy.Script:1: 'then' expected near '='
what i did after and then it didnt have the red line under it
if script.Parent.Humanoid.Health == 0 then local e = Instance.new("Explosion",Guy) e.Position = workspace.Guy.Torso.Position.Value end
Now output doesnt say anything but it still doesnt give the explosion
|
|
|
| Report Abuse |
|
|
Soquick
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 1497 |
|
| |
|
|
| 02 Sep 2013 11:55 AM |
Your code: if script.Parent.Humanoid.Health = 0 then What is should be: if script.Parent.Humanoid.Health == 0 then
|
|
|
| Report Abuse |
|
|
Soquick
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 1497 |
|
|
| 02 Sep 2013 11:57 AM |
guy = workspace.Guy if script.Parent.Humanoid.Health == 0 then local e = Instance.new("Explosion",Guy) e.Position = Guy:GetModelCFrame().p end |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 02 Sep 2013 12:07 PM |
| Oh, i g2g right now so ill check later if they work |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 02 Sep 2013 12:20 PM |
| The proposed solutions would have one issue, if the humanoid's health wasn't equal to zero at the exact time the script was executed nothing would happen. Look into the 'Died' event. |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 02 Sep 2013 12:39 PM |
| How would i fix that? Put a while true do? |
|
|
| Report Abuse |
|
|
KingJacko
|
  |
| Joined: 20 Jun 2008 |
| Total Posts: 3944 |
|
|
| 02 Sep 2013 12:44 PM |
| nvm im dumb that doesnt have to do with anything here |
|
|
| Report Abuse |
|
|