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

Can someone point me to a wiki about touching? For instance two bricks have to keep touching. [closed]

Asked by 6 years ago

Like for a script to only work when two bricks in the work space are touching and they have to keep touching for the script to keep working.

0
Theres a search bar y'know. hiimgoodpack 2009 — 6y
0
hint; a variable, `Touched`, and `TouchEnded` creeperhunter76 554 — 6y
0
variable? what variable hiimgoodpack 2009 — 6y

Closed as Not Constructive by hiimgoodpack, docrobloxman52, and lukeb50

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

To do this it’s pretty simple and there’s a search bar on the roblox wiki to where you can search functions and other scripting stuff. You only need this script inside one of the parts if you’re going to be very simple. Also, we don’t need to check for humanoids since you want to detect bricks touching each other

local var1 = workspace.PartOne
local var2 = workspace.PartTwo

script.Parent.Touched:Connect(function(part))
       if hit.Name == var1.Name or hit.Name == var2.Name then
             CODE HERE
             else
       end
end
0
Please do not post incorrect code. hiimgoodpack 2009 — 6y
Ad
Log in to vote
0
Answered by
H4X0MSYT 536 Moderation Voter
6 years ago

If you want two bricks to keep touching, as the question says, use one of the forces to move them towards eachother. Not something simple that a basic scripter should try.