ferano
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 5094 |
|
|
| 25 Mar 2016 12:11 PM |
What's wrong with this script?
game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=143384769")
wait()
local lasthealth = {} local f = function(humanoid) lasthealth[humanoid] = humanoid.Health humanoid.HealthChanged:connect(function(prop) if prop == "Health" then local lh = 0 pcall(function() lh = lasthealth[humanoid] or 0 end) if lh < humanoid.Health then script.Sound:play() end end end) end
|
|
|
| Report Abuse |
|
|
ferano
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 5094 |
|
| |
|
ferano
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 5094 |
|
| |
|
cgjnm
|
  |
| Joined: 22 Dec 2011 |
| Total Posts: 2347 |
|
|
| 25 Mar 2016 01:58 PM |
| HealthChanged is called upon when the health is changed. Saying if it is Health is unnecessary. Also, I do not see where you called the first function at, nor do I see what "humanoid" is referring to. |
|
|
| Report Abuse |
|
|
ferano
|
  |
| Joined: 23 Nov 2008 |
| Total Posts: 5094 |
|
| |
|
cgjnm
|
  |
| Joined: 22 Dec 2011 |
| Total Posts: 2347 |
|
|
| 25 Mar 2016 11:26 PM |
| When I said that I do not see something, I am saying that you should show more of the script to show what I do not see |
|
|
| Report Abuse |
|
|