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

How To Make A Touch Sensitive Block?

Asked by
Arolam 10
8 years ago
Edited by BlueTaslem 8 years ago

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?

0
Please put your code in to a code block to make it easier to read. RockerCaleb1234 282 — 8y
0
Look into the touched event Azmidium 388 — 8y
0
Edited to fix code formatting. BlueTaslem 18071 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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.

Ad

Answer this question