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: Damage To Life Script

Previous Thread :: Next Thread 
rjniscool1 is not online. rjniscool1
Joined: 28 Sep 2008
Total Posts: 123
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
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
28 Sep 2011 06:39 PM
I don't understand what you mean.
Report Abuse
ThePartyGuest is not online. ThePartyGuest
Joined: 17 Sep 2011
Total Posts: 472
28 Sep 2011 06:40 PM
I'm not sure, either..
Report Abuse
rjniscool1 is not online. rjniscool1
Joined: 28 Sep 2008
Total Posts: 123
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
ThePartyGuest is not online. ThePartyGuest
Joined: 17 Sep 2011
Total Posts: 472
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
rjniscool1 is not online. rjniscool1
Joined: 28 Sep 2008
Total Posts: 123
28 Sep 2011 06:46 PM
Yes.
Report Abuse
ThePartyGuest is not online. ThePartyGuest
Joined: 17 Sep 2011
Total Posts: 472
28 Sep 2011 06:46 PM
Hm, not sure how you would do that.
Report Abuse
rjniscool1 is not online. rjniscool1
Joined: 28 Sep 2008
Total Posts: 123
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
tiger33333321 is not online. tiger33333321
Joined: 28 Mar 2010
Total Posts: 2115
28 Sep 2011 06:48 PM
function (onconnect) bla bla bla

if damage = 50 then
Humanoid.Health.MaxHealth > 150


OR SOOMETHING BLARGH
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
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
rjniscool1 is not online. rjniscool1
Joined: 28 Sep 2008
Total Posts: 123
28 Sep 2011 06:50 PM
I'll try those out Thanks.
Report Abuse
rjniscool1 is not online. rjniscool1
Joined: 28 Sep 2008
Total Posts: 123
28 Sep 2011 07:06 PM
Doesn't work.
Report Abuse
ThePartyGuest is not online. ThePartyGuest
Joined: 17 Sep 2011
Total Posts: 472
28 Sep 2011 07:29 PM
Try and read the wiki...
Report Abuse
rjniscool1 is not online. rjniscool1
Joined: 28 Sep 2008
Total Posts: 123
28 Sep 2011 08:38 PM
That doesn't help at all with this type of script.
Report Abuse
Cachinnation is not online. Cachinnation
Joined: 21 Aug 2011
Total Posts: 1797
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 is not online. 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
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
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 is not online. pugzy
Joined: 16 Aug 2007
Total Posts: 11957
28 Sep 2011 09:18 PM
Epicfail, your script failed hard.
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
28 Sep 2011 09:28 PM
How?...
Report Abuse
pugzy is not online. 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 is not online. 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 is not online. 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
TigerBloodd is not online. TigerBloodd
Joined: 24 Oct 2010
Total Posts: 2430
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
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
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 is not online. walky3
Joined: 26 Nov 2008
Total Posts: 1415
29 Sep 2011 03:47 PM
Your max health is 100...
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