Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Any alternatives for .Touched event?

Asked by 8 years ago
Edited 8 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.

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?

0
Yes, a conditional would work DepressionSensei 315 — 8y
0
What is your situation? Why "wont it work"? BlueTaslem 18071 — 8y
0
I guess you could take a look at this, https://scriptinghelpers.org/blog/rotated-region-3 User#11440 120 — 8y

2 answers

Log in to vote
0
Answered by 8 years ago

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

Ad
Log in to vote
-1
Answered by 8 years ago

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.

0
Basically, it's 100% connecting events to a function. Stormersoul 0 — 8y
0
Hes asking for an alternative for the touched event, not the touched event itself. :/ FrostTaco 90 — 8y

Answer this question