|
| 28 Sep 2011 06:38 PM |
| Im sure alot of people heard of DBZ and if its possible to code a script when you take damage your maxhealth goes higher,Like say if you take 50 damage your maxhealth turns into 75....(25 more) health.So if anybody IS able to can you gladly do this?,ive always wanted a script like this. |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2011 06:39 PM |
| I don't understand what you mean. |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Sep 2011 06:42 PM |
| I dont understand you,its so simple.ALMOST SELF EXPLANITORY what im saying is when you take damage that ammount of damage turns into your maxhealth |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2011 06:44 PM |
| Wait, so, if you have 100 health, someone hits you and it does 25 damage,than your max health becomes 125? |
|
|
| Report Abuse |
|
|
| |
|
|
| 28 Sep 2011 06:46 PM |
| Hm, not sure how you would do that. |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2011 06:47 PM |
| Im not a good scripter either,but im sure if you know the maxhealth and damage changing script its possible.i know it is. |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2011 06:48 PM |
function (onconnect) bla bla bla
if damage = 50 then Humanoid.Health.MaxHealth > 150
OR SOOMETHING BLARGH |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2011 06:49 PM |
try something like this
health = 100 repeat wait(1) until script.Parent.Humanoid.Health ~= health damage = health - script.Parent.Humanoid.Health script.Parent.Humanoid.MaxHealth = script.Parent.Humanoid.MaxHealth + damage
|
|
|
| Report Abuse |
|
|
|
| 28 Sep 2011 06:50 PM |
| I'll try those out Thanks. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 28 Sep 2011 08:38 PM |
| That doesn't help at all with this type of script. |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2011 08:49 PM |
script.Parent.Humanoid.Changed:connect(function(p) if p == "Health" then k = script.Parent.Humanoid k.MaxHealth = k.MaxHealth + p end end)
sumtin like dat |
|
|
| Report Abuse |
|
|
pugzy
|
  |
| Joined: 16 Aug 2007 |
| Total Posts: 11957 |
|
|
| 28 Sep 2011 08:57 PM |
If a bullet or object touches you can do it like this,
function oH(hit) Damage = 25 Humanoid = hit.Parent.Humanoid if Humanoid then Humanoid.Health = Humanoid.Health - Damage -- Remove line if there is no damage being taken. Humanoid.MaxHealth = Human.MaxHealth + Damage end end
script.Parent.Touched:connect(oH)
|
|
|
| Report Abuse |
|
|
|
| 28 Sep 2011 09:06 PM |
Or put this script in the Humanoid.
Hum = script.Parent
Hum.Changed:connect(function(property) if property == "Health" then damage = 100-Hum.Health Hum.MaxHealth = Hum.MaxHeaalth + damage end end) |
|
|
| Report Abuse |
|
|
pugzy
|
  |
| Joined: 16 Aug 2007 |
| Total Posts: 11957 |
|
|
| 28 Sep 2011 09:18 PM |
| Epicfail, your script failed hard. |
|
|
| Report Abuse |
|
|
| |
|
pugzy
|
  |
| Joined: 16 Aug 2007 |
| Total Posts: 11957 |
|
|
| 28 Sep 2011 10:08 PM |
Take away the fact you misspelled, "MaxHealth". You had some bad logic.
damage = 100-Hum.Health Hum.MaxHealth = Hum.MaxHealth + damage
The first line would take away damage. Meaning, if a player had 100 health, it'd be 100-100 = 0.
So by the next line you would have Hum.MaxHealth + 0... >.> |
|
|
| Report Abuse |
|
|
Yionee
|
  |
| Joined: 03 Oct 2010 |
| Total Posts: 322 |
|
|
| 28 Sep 2011 10:26 PM |
local hum = Workspace.Yionee.Humanoid local last = hum.Health
hum.HealthChanged:connect(function() if hum.Health < last then local add_to_max = last - hum.Health hum.MaxHealth = add_to_max last = hum.Health end end) |
|
|
| Report Abuse |
|
|
Yionee
|
  |
| Joined: 03 Oct 2010 |
| Total Posts: 322 |
|
|
| 28 Sep 2011 10:28 PM |
| I did something like this in an AI that I made not too long ago and in my admin commands. If it doesn't work just PM me and I will fix it. |
|
|
| Report Abuse |
|
|
|
| 28 Sep 2011 10:30 PM |
script.Parent.Humanoid.Changed:connect(function(p) if p == "Health" then k = script.Parent.Humanoid k.MaxHealth = k.MaxHealth + p*2 end end)
TigerBloodd | Programmer | Developer |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2011 03:39 PM |
@pugzy
Hey, notice how the Event is called .Changed? So the function wouldn't fire unless the Health changed of the Humanoid, therefore it wouldn't be 100 when I say damage = 100-Hum.Health because that would return the difference of the current health and 100, giving the amount the character has been damaged. Derp. And I typed it on the forum, so I did one misspelling.
Hum = script.Parent
Hum.Changed:connect(function(property) if property == "Health" then damage = 100-Hum.Health Hum.MaxHealth = Hum.MaxHealth + damage end end) |
|
|
| Report Abuse |
|
|
walky3
|
  |
| Joined: 26 Nov 2008 |
| Total Posts: 1415 |
|
| |
|