repeat wait() until game.Players.LocalPlayer.Character local part = workspace["KeycardDoorUpdate V2"].KeycardDoor.ScriptedComponents.BillGui2 local remote = game:GetService("ReplicatedStorage"):WaitForChild("Key2") local char = game.Players.LocalPlayer.Character
local hrp = char.HumanoidRootPart
function openn2(inputName, state, obj) if inputName == "Open2" and state == Enum.UserInputState.Begin and game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then remote:FireServer(true) print("remote fired") elseif inputName == "Open2" and state == Enum.UserInputState.Begin and not game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then remote:FireServer(false) print("remote fired, false") end end
while (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do wait(0.2) game.ContextActionService:BindAction("Open2", openn2, true, Enum.KeyCode.F) end
while not (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do wait(0.2) game.ContextActionService:UnbindAction("Open2") end
repeat wait() until game.Players.LocalPlayer.Character
local part = workspace["KeycardDoorUpdate V2"].KeycardDoor.ScriptedComponents.BillGui2
local remote = game:GetService("ReplicatedStorage"):WaitForChild("Key2")
local char = game.Players.LocalPlayer.Character
local hrp = char.HumanoidRootPart
function openn2(inputName, state, obj)
if inputName == "Open2" and state == Enum.UserInputState.Begin and game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(true)
print("remote fired")
elseif inputName == "Open2" and state == Enum.UserInputState.Begin and not game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(false)
print("remote fired, false")
end
end
while (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:BindAction("Open2", openn2, true, Enum.KeyCode.F)
end
while not (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:UnbindAction("Open2")
end
repeat wait() until game.Players.LocalPlayer.Character
local part = workspace["KeycardDoorUpdate V2"].KeycardDoor.ScriptedComponents.BillGui2
local remote = game:GetService("ReplicatedStorage"):WaitForChild("Key2")
local char = game.Players.LocalPlayer.Character
local hrp = char.HumanoidRootPart
function openn2(inputName, state, obj)
if inputName == "Open2" and state == Enum.UserInputState.Begin and game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(true)
print("remote fired")
elseif inputName == "Open2" and state == Enum.UserInputState.Begin and not game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(false)
print("remote fired, false")
end
end
while (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:BindAction("Open2", openn2, true, Enum.KeyCode.F)
end
while not (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:UnbindAction("Open2")
end
repeat wait() until game.Players.LocalPlayer.Character
local part = workspace["KeycardDoorUpdate V2"].KeycardDoor.ScriptedComponents.BillGui2
local remote = game:GetService("ReplicatedStorage"):WaitForChild("Key2")
local char = game.Players.LocalPlayer.Character
local hrp = char.HumanoidRootPart
function openn2(inputName, state, obj)
if inputName == "Open2" and state == Enum.UserInputState.Begin and game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(true)
print("remote fired")
elseif inputName == "Open2" and state == Enum.UserInputState.Begin and not game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(false)
print("remote fired, false")
end
end
while (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:BindAction("Open2", openn2, true, Enum.KeyCode.F)
end
while not (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:UnbindAction("Open2")
end
repeat wait() until game.Players.LocalPlayer.Character
local part = workspace["KeycardDoorUpdate V2"].KeycardDoor.ScriptedComponents.BillGui2
local remote = game:GetService("ReplicatedStorage"):WaitForChild("Key2")
local char = game.Players.LocalPlayer.Character
local hrp = char.HumanoidRootPart
function openn2(inputName, state, obj)
if inputName == "Open2" and state == Enum.UserInputState.Begin and game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(true)
print("remote fired")
elseif inputName == "Open2" and state == Enum.UserInputState.Begin and not game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(false)
print("remote fired, false")
end
end
while (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:BindAction("Open2", openn2, true, Enum.KeyCode.F)
end
while not (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:UnbindAction("Open2")
end
repeat wait() until game.Players.LocalPlayer.Character
local part = workspace["KeycardDoorUpdate V2"].KeycardDoor.ScriptedComponents.BillGui2
local remote = game:GetService("ReplicatedStorage"):WaitForChild("Key2")
local char = game.Players.LocalPlayer.Character
local hrp = char.HumanoidRootPart
function openn2(inputName, state, obj)
if inputName == "Open2" and state == Enum.UserInputState.Begin and game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(true)
print("remote fired")
elseif inputName == "Open2" and state == Enum.UserInputState.Begin and not game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(false)
print("remote fired, false")
end
end
while (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:BindAction("Open2", openn2, true, Enum.KeyCode.F)
end
while not (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:UnbindAction("Open2")
end
repeat wait() until game.Players.LocalPlayer.Character
local part = workspace["KeycardDoorUpdate V2"].KeycardDoor.ScriptedComponents.BillGui2
local remote = game:GetService("ReplicatedStorage"):WaitForChild("Key2")
local char = game.Players.LocalPlayer.Character
local hrp = char.HumanoidRootPart
function openn2(inputName, state, obj)
if inputName == "Open2" and state == Enum.UserInputState.Begin and game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(true)
print("remote fired")
elseif inputName == "Open2" and state == Enum.UserInputState.Begin and not game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(false)
print("remote fired, false")
end
end
while (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:BindAction("Open2", openn2, true, Enum.KeyCode.F)
end
while not (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:UnbindAction("Open2")
end
repeat wait() until game.Players.LocalPlayer.Character
local part = workspace["KeycardDoorUpdate V2"].KeycardDoor.ScriptedComponents.BillGui2
local remote = game:GetService("ReplicatedStorage"):WaitForChild("Key2")
local char = game.Players.LocalPlayer.Character
local hrp = char.HumanoidRootPart
function openn2(inputName, state, obj)
if inputName == "Open2" and state == Enum.UserInputState.Begin and game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(true)
print("remote fired")
elseif inputName == "Open2" and state == Enum.UserInputState.Begin and not game:GetService("Players").LocalPlayer:FindFirstChild("Keycard Level 4") then
remote:FireServer(false)
print("remote fired, false")
end
end
while (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:BindAction("Open2", openn2, true, Enum.KeyCode.F)
end
while not (hrp.Position - part.Position).magnitude and (hrp.Position - part.Position).magnitude <= 5 do
wait(0.2)
game.ContextActionService:UnbindAction("Open2")
end

2 comments
Please insert all the code into a Lua box properly. Paste all the code inside the ~~~~~'s. They cannot be on the same line. Also post what the error message is, and what line its supposed to be on.
^^^ And provide some more context.