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

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

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.

3 comments

0

Theres a search bar y'know.

0

hint; a variable, Touched, and TouchEnded

0

variable? what variable

2 answers

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

1 comment

0

Please do not post incorrect code.

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.

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