I have looked through the Player API in the wiki and I didn't find anything to do with this. I was wondering if you could detect if someone touched a brick. Is this even possible? If it is could you explain it to me? Due to confusion this is basically what I would want if I wanted this script.
-- NOT THIS part.Touched:connect(function() print("Hi!") end) -- I need something like this game.Players.PlayerAdded:connect(function(player) player.Touched:connect(function() -- I would want something like this where it checks to see if the player touched it (and yes I know that player.Touched is not a real thing) print("Hi!") end) end)
If you are talking about a script that works when you touch a brick
script.Parent.Touched:connect(OnTouch)
if you want it to show you touched it
varTouched = false function OnTouch(Part) varTouched = true wait(0.5) print ("" ..varTouched.. "") end script.Parent.Touched:connect(OnTouch)
function onTouch(hit) --your stuff-- end Part.Touched:connect(onTouch) if Part.hit then print("you hit it") end
this should work