this is a keycard door the opendoor part works but kill player doesnt can some one edit the bottom bit. i will answer any comments. dont edit the top bit just where i marked and below thx

local hi = false

local keycard = "Keycard"

script.Parent.Touched:Connect(function(hit)

local character = hit.Parent

local player = game.Players:GetPlayerFromCharacter(character)

if player then

local backpack = player.Backpack

if backpack:FindFirstChild(keycard) or character:FindFirstChild(keycard) then

if not hi then

hi = true

print("opendoor")

wait(8.5)

hi = false
--edit here down VVV

else

if not hi then

hi = true

print("killplayer")

wait(8.5)

hi = false

end

end

end

end

end

)