You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? To avoid the error and make it work
-
What is the issue? I get the error Workspace.Door.DoorFramework1:19: attempt to index nil with ‘WaitForChild’
-
What solutions have you tried so far? Not much really. Roblox assistant also wont really help
local TweenService = game:GetService("TweenService")
local Door = script.Parent
local DoorLeft = Door.DoorLeft
local DoorRight = Door.DoorRight
local lockin = script.Parent.DoorSensorInn.Locked
local lockout = script.Parent.DoorSensorOut.Locked
local sound2 = script.Parent["door open metal"]
local granted = script.Parent["SBAudio Female Voice: Access Granted"]
local denied = script.Parent["SBAudio Female Voice: Access Denied"]
local player = game.Players.LocalPlayer
local Open = false
local DoorPos = 0
local DoorSpeed = 3
local DoorOpenTime = 1.5
local player = game.Players.LocalPlayer
local backpack = player:WaitForChild("Backpack") -- This is the error line
-- Clone the keycard from the StarterPack to the player's backpack
local keycard = game:GetService("StarterPack"):FindFirstChild("Keycard")
if keycard then
keycard:Clone().Parent = backpack
end
local player = game.Players.LocalPlayer
local card = player.Backpack:FindFirstChild("Keycard")
if card then
Why is the error occurring at line 19?