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: Help with this script? hit.Parent related.

Previous Thread :: Next Thread 
badgraphix is not online. badgraphix
Joined: 26 Nov 2007
Total Posts: 22800
23 Jul 2012 12:25 AM
function onTouched(hit)
if hit.Parent == script.Parent.Parent.Location1 then
print("HIT LOC1")
end

if hit.Parent == script.Parent.Parent.Location2 then
print("HIT LOC2")
end

end


script.Parent.Touched:connect(onTouched)


I'm trying to get it so it'll print the respective messages if the thing script.Parent touched is those respective objects. Can some reformat this for me so it actually works?
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
23 Jul 2012 12:28 AM
script.Parent.Touched:connect(function(hit)
if hit.Parent == script.Parent.Parent.Location1 then
print("HIT LOC1")
else
print("HIT LOC2")
end
end)
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
23 Jul 2012 12:29 AM
Is this related to your problem with making a moving platform with a consistent speed? If so, please check that thread.
If not, then try checking if hit is Location1.Part, or use an invisible brick maybe .1 studs out of the wall and try detecting that.
Report Abuse
badgraphix is not online. badgraphix
Joined: 26 Nov 2007
Total Posts: 22800
23 Jul 2012 12:34 AM
It is about that. I kind of posted this in a rush and didn't take a look at my other thread.

~http://www.roblox.com/Castle-in-the-Sky-place?id=75647812
Report Abuse
adark is not online. adark
Joined: 13 Jan 2008
Total Posts: 6412
23 Jul 2012 12:38 AM
Did my suggestion make you pause for a moment and contemplate headdesking? I ask because that would be my response in that situation.
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