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: Detecting when a local part has been touched?

Previous Thread :: Next Thread 
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
01 Feb 2014 10:55 AM
Since you can't place scripts in Local parts I can't detect when this local part has been hit by the player it belongs to.

Is there a way to access this local part to find out when it is hit?


"Another thing to note is that scripts, local or not, will not run inside the camera. If a local part is to be scripted, the script controlling it must reside elsewhere." - Wiki
Report Abuse
shawnyg is not online. shawnyg
Joined: 21 Apr 2011
Total Posts: 1428
01 Feb 2014 10:58 AM
game.Workspace.Part.Touched:connect(function(hit)
if hit.Parent:findFirstChild("Humanoid") then
plr = game.Players:GetPlayerFromCharacter(hit.Parent)
print(plr.Name.." has touched the local part!")
end
end)
~Hope I helped, if you need a script, PM me. ~The G~ ~CAT General Shawnyg~
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
01 Feb 2014 11:00 AM
I'm not that stupid. You've read what I said wrong, in fact you haven't read it at all.
Report Abuse
shawnyg is not online. shawnyg
Joined: 21 Apr 2011
Total Posts: 1428
01 Feb 2014 11:01 AM
Gee, not even a "thanks for trying"...
http://wiki.roblox.com/index.php?title=Time#time

~Hope I helped, if you need a script, PM me.~ ~The G~ ~CAT General Shawnyg~
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
01 Feb 2014 11:04 AM
Thanks for trying, I'm just annoyed hundreds of lines of code are being halted by this one issue. I don't see how a link to a time function is going to solve it.
Report Abuse
MarioKartAddict is not online. MarioKartAddict
Joined: 11 Nov 2009
Total Posts: 42774
01 Feb 2014 11:43 AM
can you run a local script in the local part?
Report Abuse
jakedies is not online. jakedies
Joined: 19 Oct 2008
Total Posts: 86
01 Feb 2014 12:27 PM
Try this in a local script in like, PlayerGui.

Game.Workspace.CurrentCamera:WaitForChild("Part")P:Touched:connect(...)
Report Abuse
opplo is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
01 Feb 2014 02:12 PM
So put its location in the connection line?
Ill try it.
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
01 Feb 2014 02:20 PM
Doesn't matter.

part = game.Workspace:WaitForChild("CurrentCamera")

part.Touched:connect(function())
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
01 Feb 2014 02:21 PM
forgot to define the part

part = game.Workspace:WaitForChild("CurrentCamera")["Part"]

part.Touched:connect(function())
Report Abuse
jakedies is not online. jakedies
Joined: 19 Oct 2008
Total Posts: 86
01 Feb 2014 02:50 PM
lolb, that's not going to work, at all
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