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

How To Make A Touch Sensitive Block?

So I have this script

local Nuber = 20
local NuberGoal = 21
wait(1)
if Nuber > NuberGoal then
	script.Parent.CanCollide = false
else
	script.Parent.CanCollide = true
end

And I want it to change the Nuber > NuberGoal part to something along the lines of when someone touches it from a certain direction it turns off CanCollide. Can someone help me?

3 comments

0

Please put your code in to a code block to make it easier to read.

0

Look into the touched event

0

Edited to fix code formatting.

1 answer

✓ Accepted answer

put a hit function in there somewhere, you want it to be a touch, right?

script.Parent.Touched:connect(
function(hit)
	--code
end)

I'm basic, my mind is simplicity, but at the same time,t his might help a lot.

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