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

Touched Event problem?

When the brick containing this script, touches the brick that is named "Stop" it should change the bool value named Anchor to true, I even tried adding a print to check if it is working but the print statement was not printed so I can say that this script is not working.

What I mean: https://imgbomb.com/i/?IlZhv

After doing some tests, I came to the conclusion that this brick is detecting everything else that touches it except the brick named "Stop"...

Also, the brick containing the script is being cframed slowly through the brick named "Stop" and seems like that way it doesn't detect the brick named "Stop", how can I fix this problem?

function Stop(hit)
	print("it is working")
	if hit.Name == 	"Stop" then
	script.Parent.Parent.Settings.Anchor.Value = true
	end
end
script.Parent.Touched:connect(Stop)

2 answers

Line 4 is your problem you did:

    script.Parent.Parent.Settings.Anchor.Value = true

You should just do:

    script.Parent.Parent.Settings.Anchor = true

Hope it helps!

script.Parent.Touched:connect(function(hit)
if script.Parent:findFirstChild('Stop') then
if hit.Parent.Name == 'Touch' then
script.Parent.Parent.Settings.Anchor.Value  =  true
end
	end
		end)

Try this it may work.

2 comments

0

Stealing meh answer breh????!?!?@1/1!?11/1/1 xD

0

What how?

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