Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

True when you enter, false when you leave?

Hi,

I want to make a thing where the if you enter the brick something will happen, and when you leave the brick it stops. Can anyone help me? Is there tutorials on YouTube, or Roblox Wiki? Thanks for reading, and helping me out. Thanks!

  • BloodySoldier2002

1 answer

✓ Accepted answer

In this case I would use Touched and TouchEnded.

script.Parent.Touched:connect(function(hit)
	-- Insert what happens once it touches brick
	end
end)

If you want to end it, say when they walk out of the brick, you would use this.

script.Parent.TouchEnded:connect(function(hit)
	-- Insert opositite of above. The code that will change it back
	end
end)

As you requested, you wanted to see a video or wiki article on this. I linked them both below.

Touched: http://wiki.roblox.com/index.php?title=API:Class/BasePart/Touched TouchEnded: http://wiki.roblox.com/index.php?title=API:Class/BasePart/TouchEnded

Hope this helps!

3 comments

0

Thank you so much!

0

If you could please accept my answer it would be much appreciated.

0

Oh sry, I'm new to ScriptingHelpers. Thanks again!

This discussion is preserved as it was. New answers, comments, and votes are closed.