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

Apparently I'm not allowed to have 2 "script"s in the same script?

script.Parent.CardReader2.Scanner.Touched:Connect(function(hit)
	if hit.Parent.Name == "O5 Keycard" then
		tween:Play()
		debouce = true
		wait(3.5)
		debouce = false
	end
end
script.Parent.CardReader.Scanner.Touched:Connect(function(hit)
	if hit.Parent.Name == "O5 Keycard" then
		tween:Play()
		debouce = true
		wait(3.5)
		debouce = false
	end
end)

The first script on the second block of code comes up with an error whenever I try to run the script. The first block works fine, but for some reason the second block won't. Anyone able to help?

5 comments

0

By the way, this is the same script. Both blocks are in the same script.

0

Any errors? Also use another debounce for the second script.

0

Still got a red line underneath that script

0

try putting a parenthesis after at last end of the first block

1 answer

✓ Accepted answer

You forgot to close the end with a bracket.

script.Parent.CardReader2.Scanner.Touched:Connect(function(hit) 
    if hit.Parent.Name == "O5 Keycard" then
        tween:Play()
        debouce = true
        wait(3.5)
        debouce = false
    end
end) --Right here.

2 comments

0

ohhhh, im so stupid

0

Don't worry. It happens.

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