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: Activation on touch?

Previous Thread :: Next Thread 
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
14 Apr 2012 07:52 PM
How would i make it so that i can have one script inside of each person, and when they touch something, with anypart of there body, the script fires?
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
14 Apr 2012 08:04 PM
You make a script that puts it in the player's then,

for i,v in pairs(script.Parent:GetChildren()) do
if v:IsA("Part") then
v.Touched:connect(function(Part)
--Script
end)
end
end
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
14 Apr 2012 08:14 PM
Would this work , just as much as that?

debounce = false

function HeadTouched(hit)
if debounce == false then
debounce = true
msg = Instance.new("Message", Workspace)
msg.Text = "Head Touched"
wait(3)
msg:Destroy()
debounce = false
end
end

script.Parent:FindFirstChild("Head").Touched:connect(HeadTouched)

function LeftArmTouched(hit)
if debounce == false then
debounce = true
msg = Instance.new("Message", Workspace)
msg.Text = "Left Arm Touched"
wait(3)
msg:Destroy()
debounce = false
end
end

script.Parent:FindFirstChild("Left Arm").Touched:connect(LeftArmTouched)
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
14 Apr 2012 08:15 PM
@Un

I'm not sure, but if it did, it is not as efficient...

† KMXD †
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
14 Apr 2012 08:23 PM
ok, well thanks for the help.
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