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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Is this a correct way to call a function?

Previous Thread :: Next Thread 
Lem0nzz2 is not online. Lem0nzz2
Joined: 03 Jul 2014
Total Posts: 211
01 Jan 2015 10:37 AM
I want a target to takedamage, so I'd have to have the player touch the RightArm of the player that's punching, kicking etc. So how would I connect a touched event when a target touches a player?

User.Character.Torso["RightArm"].Touched:connect(function()

end)

Something like this too?

mouse.Target.Touched:connect(function(hit)

mouse.Target.Humanoid:TakeDamage(20)

end)
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
01 Jan 2015 10:58 AM
your pretty vague, but if you define User and mouse then yeah those should work
Report Abuse
SLY3 is not online. SLY3
Joined: 10 Jul 2008
Total Posts: 1700
01 Jan 2015 11:59 AM
mouse.Target.Humanoid wouldn't work, since a Humanoid would NEVER be inside a part, only a model (the player)

So use mouse.Target.Parent.Humanoid
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
01 Jan 2015 12:02 PM
Right Arm is located directly in Character. You can only using RightArm when referring to the Humanoid to reference the Right Arm.
So:
User.Character["Right Arm"]
or
User.Character.Humanoid.RightArm;
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