Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Proximity Prompt with a door not working?

Asked by 3 years ago

So this is only a test script, but for some reason when I press E, it doesn't print or play the sounds.

local ProximityPromptService = game:GetService("ProximityPromptService")
local TweenService = game:GetService("TweenService")
local closeDoor = script.Parent:WaitForChild("CloseDoor")
local openDoor = script.Parent:WaitForChild("OpenDoor")
local door =  script.Parent:WaitForChild("Door")
local sounds = script.Parent.Sounds
local prompt1 = script.Parent.Scanner1.CardScanner.Attachment.ProximityPrompt
local prompt2 = script.Parent.Scanner2.CardScanner.Attachment.ProximityPrompt

prompt1.Triggered:Connect(function(player)
    print("Opened!")
    sounds.Accept:Play()
    sounds.Open:Play()
    wait(3)
    sounds.Close:Play()
end)

1 answer

Log in to vote
0
Answered by 3 years ago

Never mind, I just didn't define the right prompt

Ad

Answer this question