I am currently trying to create a proximity prompt activated door.
The door is supposed to check if they have a keycard, then if they do the door opens.
The issue is the door not opening. But no errors are printed on output.
Script:
local ProximityPrompt = script.Parent
local Door = script.Parent.Parent.Parent.Parent.Parent.Door
ProximityPrompt.Triggered:Connect(function(player)
if ProximityPrompt.ActionText == "Open" then
if player.Character:FindFirstChild('Level_2') or player.Character:FindFirstChild('Level_3') or player.Character:FindFirstChild('Level_4') or player.Character:FindFirstChild('Raider') or player:FindFirstChild('Level_2') or player:FindFirstChild('Level_3') or player:FindFirstChild('Level_4') or player:FindFirstChild('Raider') then
Door.Transparency = 1
Door.CanCollide = false
ProximityPrompt.ActionText = "Close"
print(player.Name)
end
end
end)
Just place print statements through different parts of the script so you can see what is working and what isn’t.
local ProximityPrompt = script.Parent
local Door = script.Parent.Parent.Parent.Parent.Parent.Door
ProximityPrompt.Triggered:Connect(function(player)
if ProximityPrompt.ActionText == "Open" then
if player.Character:FindFirstChild('Level_2') or player.Character:FindFirstChild('Level_3') or player.Character:FindFirstChild('Level_4') or player.Character:FindFirstChild('Raider') or player:FindFirstChild('Level_2') or player:FindFirstChild('Level_3') or player:FindFirstChild('Level_4') or player:FindFirstChild('Raider') then
print("Working") -- add these to test
Door.Transparency = 1
Door.CanCollide = false
ProximityPrompt.ActionText = "Close"
print(player.Name)
end
end
end)
if player.Character:FindFirstChild('Level_2') or player.Character:FindFirstChild('Level_3') or player.Character:FindFirstChild('Level_4') or player.Character:FindFirstChild('Raider') or player:FindFirstChild('Level_2') or player:FindFirstChild('Level_3') or player:FindFirstChild('Level_4') or player:FindFirstChild('Raider') then