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 » Scripters
Home Search
 

Re: TakeDamage() method help

Previous Thread :: Next Thread 
tentergram is not online. tentergram
Joined: 13 Apr 2013
Total Posts: 2446
15 Sep 2015 05:57 PM
v
light.Touched:connect(function(daa)
local hum = daa.Parent:findFirstChild("Humanoid")
if hum then
hum:takeDamage(32)
end
end)

problem: also damages my humanoid.Health.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
15 Sep 2015 05:58 PM
isn't that what it's supposed to do
Report Abuse
Hvxbyte is not online. Hvxbyte
Joined: 19 Aug 2015
Total Posts: 410
15 Sep 2015 05:59 PM
It's the whole point.
Report Abuse
tentergram is not online. tentergram
Joined: 13 Apr 2013
Total Posts: 2446
15 Sep 2015 05:59 PM
I don't want it to damage my health
Report Abuse
Someguy1002 is not online. Someguy1002
Joined: 27 Dec 2012
Total Posts: 195
15 Sep 2015 06:01 PM
light.Touched:connect(function(daa)
local hum = daa.Parent:findFirstChild("Humanoid")
if hum then
FUNCTION HERE
end
end)
Report Abuse
DeathsLASTwords is not online. DeathsLASTwords
Joined: 28 Jan 2012
Total Posts: 2701
15 Sep 2015 06:07 PM
lmfao what do you want it to do then, what DID YOU EXPECT, for :takeDamage? lmao the forums these days just keep getting better and better.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
15 Sep 2015 06:09 PM
^...
Report Abuse
tentergram is not online. tentergram
Joined: 13 Apr 2013
Total Posts: 2446
15 Sep 2015 06:10 PM
I'm only 11, I have alot to learn.
Report Abuse
Hvxbyte is not online. Hvxbyte
Joined: 19 Aug 2015
Total Posts: 410
15 Sep 2015 06:11 PM
Good luck to you kid.
Report Abuse
tentergram is not online. tentergram
Joined: 13 Apr 2013
Total Posts: 2446
15 Sep 2015 06:24 PM
bump
Report Abuse
NotAshley is not online. NotAshley
Joined: 16 Jan 2014
Total Posts: 14257
15 Sep 2015 06:30 PM
TakeDamage damages the humanoid's health. It does nothing else.

What else are you trying to do?
Report Abuse
Foreboding is not online. Foreboding
Joined: 22 Aug 2010
Total Posts: 19154
15 Sep 2015 06:37 PM
"im only 11"

that shouldn't make a difference

at 8 I knew what damage meant


#code print ("Shots fired, ready for the war!") -- Currently working on Gui's
Report Abuse
tentergram is not online. tentergram
Joined: 13 Apr 2013
Total Posts: 2446
15 Sep 2015 06:54 PM
"At 8 I knew what damage meant"
but did you know how to script?


I am also trying to prevent damage to myself.
Report Abuse
Foreboding is not online. Foreboding
Joined: 22 Aug 2010
Total Posts: 19154
15 Sep 2015 06:55 PM
I was actually teaching myself Javascript

still you should know what "damage" means at 11

thats a little ridiculous


#code print ("Shots fired, ready for the war!") -- Currently working on Gui's
Report Abuse
NotAshley is not online. NotAshley
Joined: 16 Jan 2014
Total Posts: 14257
15 Sep 2015 06:55 PM
You haven't told us what you're trying to do. The very definition of TakeDamage is dealing damage to a humanoid, yet you're saying you want something else to happen instead. What is that thing that you want to happen?
Report Abuse
Hvxbyte is not online. Hvxbyte
Joined: 19 Aug 2015
Total Posts: 410
15 Sep 2015 07:57 PM
"I am also trying to prevent damage to myself."

It's right in front of you...
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
15 Sep 2015 07:59 PM
TakeDamage is pretty self explanatory; take... damage... if that doesn't help;
http://wiki.roblox.com/index.php?title=API:Class/Humanoid/TakeDamage
Report Abuse
Hvxbyte is not online. Hvxbyte
Joined: 19 Aug 2015
Total Posts: 410
15 Sep 2015 08:42 PM
The first example is for defined players only (obviously, you define the players in the table Gods).

local Gods = {
"tentergram";
}

local Check = function(Player)
for _, God in next, Gods do
if Player.Name:lower() = God:lower() then
return true;
end
end
end

game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
if Check(Player) == true then
local Humanoid = Character:FindFirstChild("Humanoid");
Humanoid.Changed:connect(function(Health)
Humanoid.Health = Humanoid.MaxHealth;
end
end
end)
end)

However, if you want everyone to be, said 'invincible', then:

game.Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:connect(function(Character)
local Humanoid = Character:FindFirstChild("Humanoid");
Humanoid.Changed:connect(function(Health)
Humanoid.Health = Humanoid.MaxHealth;
end
end)
end)
Report Abuse
DeathsLASTwords is not online. DeathsLASTwords
Joined: 28 Jan 2012
Total Posts: 2701
15 Sep 2015 08:45 PM
how 2 make urself god moed in robux:

furst make an player(haha god)den u godmoed him and win ha nubs thes dais

game.Players.PlayerAdded:connect(function(player)
if player.Name == "tentergram" then
wait(5)
player.Character.Humanoid.Health = math.huge
end
end)


(This is my signature): Im extremely sarcastic, but most of the time I will provide useful info for you! :)
Report Abuse
tentergram is not online. tentergram
Joined: 13 Apr 2013
Total Posts: 2446
19 Sep 2015 01:49 PM
Found a solution
you guys weren't very helpful.
Report Abuse
CaptainGector is not online. CaptainGector
Joined: 02 May 2014
Total Posts: 487
19 Sep 2015 02:00 PM
We are never helpful. If you need help... I don't know.
Report Abuse
Pinkerten is not online. Pinkerten
Joined: 03 Aug 2014
Total Posts: 840
19 Sep 2015 02:06 PM
We are always helpful but your a dumbass
Report Abuse
tentergram is not online. tentergram
Joined: 13 Apr 2013
Total Posts: 2446
19 Sep 2015 02:08 PM
you're a dumbass when it comes to grammar.
Also, because I don't know certain things about scripting, makes me a dumbass?
that's like calling 48% of the world dumbass.
Report Abuse
Pinkerten is not online. Pinkerten
Joined: 03 Aug 2014
Total Posts: 840
19 Sep 2015 02:10 PM
the function "Take damage" damages the humanoid, it is 100% obvious and has nothing to do with scripting. You expected to do something else. WHICH YOU NEVER TOLD US. Im sure someone would have helped you if you actually told us what you wanted to accomplish.
But no you just sat there and did nothing.
Report Abuse
TheCurrencyExchange is not online. TheCurrencyExchange
Joined: 09 Dec 2012
Total Posts: 6704
19 Sep 2015 02:11 PM
you dont want him to take damage anymore?
#code

okay
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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