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: how do you find a Players torso?

Previous Thread :: Next Thread 
JonathanSwag is not online. JonathanSwag
Joined: 30 Aug 2011
Total Posts: 1012
04 Sep 2011 11:31 AM
I have this:

local t = humanoid.Parent:findFirstChild("Torso")


??
Report Abuse
Cachinnation is not online. Cachinnation
Joined: 21 Aug 2011
Total Posts: 1797
04 Sep 2011 11:32 AM
game.Players:GetPlayerFromCharacter(game.Players.LocalPlayer)--localscript
Report Abuse
JonathanSwag is not online. JonathanSwag
Joined: 30 Aug 2011
Total Posts: 1012
04 Sep 2011 11:33 AM
wheres the Torso part? where do I put it in?
Report Abuse
Fl0x is not online. Fl0x
Joined: 06 Aug 2010
Total Posts: 5169
04 Sep 2011 11:34 AM
@Cach
That wouldn't work, you have to give the character as parameter for this method.
Also, that doesn't tell him how to find the torso.
To be honest, you aren't really helpful.
Also,
local t = humanoid.Parent:findFirstChild("Torso")
Should be fine, just make sure humanoid is defined.
Report Abuse
JonathanSwag is not online. JonathanSwag
Joined: 30 Aug 2011
Total Posts: 1012
04 Sep 2011 11:37 AM
Aww, I don't have it defined...

hmm, can you give me and example how I can define it?

Report Abuse
JonathanSwag is not online. JonathanSwag
Joined: 30 Aug 2011
Total Posts: 1012
04 Sep 2011 11:39 AM
?
Report Abuse
Fl0x is not online. Fl0x
Joined: 06 Aug 2010
Total Posts: 5169
04 Sep 2011 11:39 AM
workspace.Part.Touched:connect(function(p)
if p.Parent:findFirstChild("Humanoid") then
t=p.Torso
end
end)

Or for a specific player

workspace["Player Name here"].Torso
Report Abuse
Cachinnation is not online. Cachinnation
Joined: 21 Aug 2011
Total Posts: 1797
04 Sep 2011 11:40 AM
lololol

fL0x

thats a new one
Report Abuse
JonathanSwag is not online. JonathanSwag
Joined: 30 Aug 2011
Total Posts: 1012
04 Sep 2011 11:42 AM
So..:


function onTouch(part)
workspace.Part.Touched:connect(function(p)
if p.Parent:findFirstChild("Humanoid") then
t=p.Torso
end
end)
local t = Humanoid.Parent:findFirstChild("Torso")
if t~=nil then
local c = Instance.new("Part")
c.CanCollide = false
c.Anchored = true
c.BrickColor = BrickColor.new("Really black")
c.BrickShape = BrickShape.new("ball")
c.BrickSize = Bricksize.new(9,9,9)
end
end

script.Parent.Touched:connect(onTouch)
Report Abuse
EntertainedStickDude is not online. EntertainedStickDude
Joined: 11 Jun 2010
Total Posts: 3363
04 Sep 2011 11:42 AM
game.Workspace.Person299.Torso
Report Abuse
JonathanSwag is not online. JonathanSwag
Joined: 30 Aug 2011
Total Posts: 1012
04 Sep 2011 11:44 AM
I don't want a certain player.. >.>

I want a "if everyone touched it, it will happend to them."
Report Abuse
JonathanSwag is not online. JonathanSwag
Joined: 30 Aug 2011
Total Posts: 1012
04 Sep 2011 11:47 AM
output:

Workspace.Part.Script:7: attempt to index global 'Humanoid' (a nil value)
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