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

KeycardReader1 is not a valid member of model but its in there?

Hello, If there are any mods here, why did you close "Why does rightdoor delay itself upon opening"?

Anyway. Same problem, free modeled scp door but wont open and it says in output "KeycardReader1 is not a valid member of model" can anyone help?

Script



local Door = script.Parent.Door
local KeycardReader1 = script.Parent.KeycardReader1
local KeycardReader2 = script.Parent.KeycardReader2
local Open = false

local Level = 3 --The KeyCard Level, anything above this level will also work. Levels are from 1 - 5.

local GrantedSound = Door.Granted
local DeniedSound = Door.Denied
local OpenSound = Door.DoorOpen
local CloseSound = Door.DoorClose

local Levels = {"Omni"}

for i = 1, 5 do
	if i >= Level then
		table.insert(Levels, i)
	end
end

local Debounce = false
function ReaderTouched(Hit)
	if not Debounce then
		Debounce = true
		if Hit.Parent and Hit.Parent:IsA("Tool") and Hit.Parent.Name:sub(1,5) == "[SCP]" then
			local Found = false
			for i,v in pairs(Levels) do
				if Hit.Parent.Name:find(v) then
					Found = true
				end
			end
			if Found then
				GrantedSound:Play()
				if Open then
					wait(0.75)
					Open = false
					CloseSound:Play()
					for i = 3,(Door.Size.z / 0.15) do
						Door.CFrame = Door.CFrame + (Door.CFrame.lookVector * 0.15)
						wait()
					end
				else
					wait(0.75)
					Open = true
					OpenSound:Play()
					for i = 3,(Door.Size.z / 0.15) do
						Door.CFrame = Door.CFrame - (Door.CFrame.lookVector * 0.15)
						wait()
					end
				end
			else
				DeniedSound:Play()
			end
		end
		wait(0.5)
		Debounce = false
	end
end
KeycardReader1.Touched:connect(ReaderTouched)
KeycardReader2.Touched:connect(ReaderTouched)

Be careful when looking. Video: https://www.youtube.com/watch?v=x58K6unNTPc&feature=youtu.be Picture https://cdn.discordapp.com/attachments/505300456319221773/592981840512679957/unknown.png

2 comments

0

Seems you ungrouped door. try insert without ungrouping.

0

I didnt.

1 answer

So you using free model scp door script, you need change names keycard readers to your keycard reader names inside model. without this it will say "KeycardReader" is not valid member of model" probably.

2 comments

0

Or send me this free model scp door link, i am will see what's wrong.

0

https://www.roblox.com/catalog/03363282320/redirect Its a custom one, I'm working on it.

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