Im trying to make a tweenservice based door that requires a keycard to be scanned before it opens. I have a system with the keycard item where it has values in each keycard for each door it can open, However my code isn't working.
Ive tried everything I can think of to fix it.
Doors Code:
script.Parent.Scanner1.ProximityPrompt.Triggered:Connect(function(plr) local Keycard for i,v in ipairs(plr.Character:GetChildren()) do if v:IsA("Tool") then Keycard = v break end end local Swipe = plr.Character.Humanoid.Animator:LoadAnimation(anim) local Access = Keycard if Access.GeneralAccess.Value == true then plr.Character.HumanoidRootPart.CFrame = CFrame.new(POS1) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) plr.Character.HumanoidRootPart.Anchored = true Swipe:Play() wait(2) plr.Character.HumanoidRootPart.Anchored = false DoorOpenTween:Play() script.Parent.Scanner1.Light.Color = Color3.fromRGB(131, 89, 255) wait(3.5) script.Parent.Scanner1.Light.Color = Color3.fromRGB(255, 89, 89) DoorCloseTween:Play() end end)
Error: **Workspace.GeneralDoor.Script:41: attempt to index nil with 'GeneralAccess' **