Pressing a button on the keyboard to open door

I have door and ProximityPrompt


And script in Workspace.
game.Workspace.Part123321.ProximityPrompt.Triggered:Connect(function(player)

game.Workspace.Part123321.Transparency = 0.5

script.Part123321.CanCollide = false

wait(1)

game.Workspace.Part123321.Transparency = 0

game.Workspace.Part123321.CanCollide = true

end

end)

But it is do not work. Help pls

Okay, firstly, that’s not going to work as it seems to just be a renamed ClickDetector.

Secondly, you want to use UIS for this; you can learn more here.

Another thing, there’s a new feature that’s coming that will do this for you, here.

No it is not renamed ClickDetector

Are there any errors in my script?

You put CanCollide true. That might be why.

No, it doesn’t even start to open

ProximityPrompt has the same insignia as ClickDetector, you can enable ProximityPrompt with BETA Features.

1 Like

@RodionPro100
You can use a ProximityPrompt:Trigggered() function that sets the CanCollide of the door to false and changes the transparency:

workspace.Part123321.ProximityPrompt.Triggered:Connect(function()
    -- What you want to happen here
end)

Also for reference, ProximityPrompt is in BETA, so they won’t be able to work in an actual roblox game, just in Studio.

1 Like