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

Any alternatives for .Touched event?

I need to use a Touched event, but I would prefer to use something else because for me it wont work. What would be the best approach to this? Would using an if statement to compare positions work?

3 comments

0

Yes, a conditional would work

0

What is your situation? Why "wont it work"?

0

I guess you could take a look at this, https://scriptinghelpers.org/blog/rotated-region-3

2 answers

A .Touched script won't work if you are trying to act on a character, since the part hits many bricks when the world is being created, however there is a video that ROBLOX did on the :Touched() event. Just search "Learning Lua ROBLOX Touched" on YouTube and you will learn about it, hope this helped you

It's a simple event.

In a script inside a part:

local part = script.Parent
part.Touched:connect(function(part)
	print(part)
end)

This would print the part's name that triggered the Touched event.

2 comments

0

Basically, it's 100% connecting events to a function.

0

Hes asking for an alternative for the touched event, not the touched event itself. :/

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