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: On torso touching object?

Previous Thread :: Next Thread 
Zecrit is not online. Zecrit
Joined: 24 Jan 2013
Total Posts: 2618
27 Sep 2014 12:17 PM
My brain is working very slowly today for some reason and I can't think of how to do this when I would be able to any other day.

Basically just a little function to detect when a players torso is touching a part with a specific name.

Use whatever variables you want, I'll modify it.
Report Abuse
FadedExistence is not online. FadedExistence
Joined: 28 Jun 2011
Total Posts: 818
27 Sep 2014 12:23 PM
function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
print'Humanoid touched a brick'
end
end

script.Parent.Touched:connect(onTouch)

Here you go, tell me exactly why you need the torso to touch a certain brick name?
Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
27 Sep 2014 12:25 PM
make a script and put it anywhere you like. put below code in it.

while true do
for i,v in pairs(game.Players:GetChildren()) do
if (v.Character) then
if not v.Character.Torso:FindFirstChild("Script") then
script.Script:Clone().Parent = v.Character.Torso
end
end
end
wait(1)
end



then, create a script INSIDE the script, and put the code below inside that script.


function touch(hit)
if hit.Name == "Yournamehere" then
--Yourcodehere
end
end
script.Parent.Touched:connect(touch)



Report Abuse
BetterBe is not online. BetterBe
Joined: 25 Jan 2009
Total Posts: 1034
27 Sep 2014 12:26 PM
@Faded I was going to reply with a similar script however by my understanding would the OP also need to know if its concurrently touching the torso, not just knowing the moment it does?
Report Abuse
Zecrit is not online. Zecrit
Joined: 24 Jan 2013
Total Posts: 2618
27 Sep 2014 12:29 PM
@Faded
GUIs and stuff

@Whoever the guy replying to faded was
Ja
Report Abuse
FadedExistence is not online. FadedExistence
Joined: 28 Jun 2011
Total Posts: 818
27 Sep 2014 12:32 PM
@^, I'm very confused on what he meant by that if he actually needed to know the parent's name or my other answer I posted.
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