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: How to check if a specific player touches a Part

Previous Thread :: Next Thread 
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
25 Dec 2016 08:53 PM
I couldn't find a way to do this,
Any wiki links, ect.
Lets say the player name is "hi"
how would I find if hi touched it so I can print ("hi touched this block") when hi touches it



"Got my cup of Coffee"
Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
25 Dec 2016 08:57 PM
bump :)


"Got my cup of Coffee"
Report Abuse
Quasar99 is not online. Quasar99
Joined: 21 Nov 2009
Total Posts: 9328
25 Dec 2016 08:58 PM
assuming the script is in the part

script.Parent.Touched:connect(function(player)
print(player.Name .. " touched this block")
end)
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
25 Dec 2016 08:59 PM
left leg touched this block!

returns the part not the player
Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
25 Dec 2016 08:59 PM
I was asking for a specific player to have to touch it so it prints.
Not a random one. Sorry for the misunderstanding


"Got my cup of Coffee"
Report Abuse
Quasar99 is not online. Quasar99
Joined: 21 Nov 2009
Total Posts: 9328
25 Dec 2016 09:00 PM
whoops

script.Parent.Touched:connect(function(player)
print(player.Parent.1Name .. " touched this block")
end)
Report Abuse
Quasar99 is not online. Quasar99
Joined: 21 Nov 2009
Total Posts: 9328
25 Dec 2016 09:00 PM
that doesnt really work either but it at least prints the player name
Report Abuse
amanda is not online. amanda
Joined: 21 Nov 2006
Total Posts: 5925
25 Dec 2016 09:05 PM
local part = script.Parent

part.Touched:connect(function(hit)
local char = hit.Parent
if game.Players:GetPlayerFromCharacter(char) then
if char.Name == "bob" then
print("bob touched me")
end
end
end)
Report Abuse
SinisterMemories is not online. SinisterMemories
Joined: 21 Mar 2013
Total Posts: 4892
25 Dec 2016 09:06 PM
@amanda
that really helps ill try to learn off that <3


"Got my cup of Coffee"
Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
25 Dec 2016 09:23 PM
@amanda

"bob touched me"
that sounds wrong








sorry for my dirty mind


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