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 » Scripters
Home Search
 

Re: Simple TOuch Script..

Previous Thread :: Next Thread 
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
26 Dec 2015 01:29 PM
Okay.. it was working when i did game.Workspace.. but I changed it up and now not functioning

function OnTouched()
print("I've run into something!")
end

part.Touched:connect(OnTouched)
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
26 Dec 2015 01:30 PM
part = script.Parent

^---
Forgot to add that so fulls cript again

part = script.Parent
function OnTouched()
print("I've run into something!")
end

part.Touched:connect(OnTouched)

Report Abuse
EllisLadon is not online. EllisLadon
Joined: 21 Jun 2012
Total Posts: 343
26 Dec 2015 01:33 PM
Is the scripts parent ACTUALLY the part?
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
26 Dec 2015 01:35 PM
Yes I got the parenting correct.
Report Abuse
wonderful72pike is not online. wonderful72pike
Joined: 13 Jul 2010
Total Posts: 7009
26 Dec 2015 01:37 PM
Is the Script enabled?
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
26 Dec 2015 01:39 PM
Script.Parent.Touched:connect(function(SomethingIsTouchingMeOMG)
print("I NEED AN ADULT")
end)
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
26 Dec 2015 01:39 PM
Here is a place.

http://www.roblox.com/games/336135286/uncopylocked-testing
Report Abuse
cbhusker is not online. cbhusker
Joined: 07 Feb 2011
Total Posts: 517
26 Dec 2015 01:39 PM
part.Touched:connect(function()
print("I've run into something!")
end)

print("Hello World!")
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
26 Dec 2015 01:46 PM
Hm.
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
26 Dec 2015 01:53 PM
Anyone know what is up.
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
26 Dec 2015 01:55 PM
all of the above should be working

it's gotta be some unknown variable on your end - are you using a Local Script? Is the script active? Where is the script located, is it truly a child of the part?
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
26 Dec 2015 02:25 PM
^ I made an uncopylocked place check it out.
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
26 Dec 2015 02:45 PM
http://www.roblox.com/games/336135286/uncopylocked-testing
Report Abuse
Hooked0nPhoenix is not online. Hooked0nPhoenix
Joined: 13 Aug 2014
Total Posts: 44
26 Dec 2015 02:46 PM
Your other part of the script is invalid so the OnTouched will not work

-Aerbin
Report Abuse
Hooked0nPhoenix is not online. Hooked0nPhoenix
Joined: 13 Aug 2014
Total Posts: 44
26 Dec 2015 02:48 PM
script.Parent:connect(function(otherPart)
print(otherPart)
otherPart:Destroy()
end)

This is invalid

-Aerbin
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
26 Dec 2015 03:08 PM
here, this is the right code:

part = script.Parent

script.Parent.Touched:connect(function(otherPart)
print(otherPart)
otherPart:Destroy()
end)


function OnTouched()
print("I've run into something!")
end

part.Touched:connect(OnTouched)

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