I don't know if this can help you, but this is an example I did:
local door = script.Parent
local player = game.Players.LocalPlayer
local locked = true
local lockpick = player.Backpack:FindFirstChild("Lockpick")
door.ProximityPrompt:Connect(function(player)
if locked then
door.ProximityPrompt:SendPrompt("Press E to try to pick the lock")
end
end)
door.Activated:Connect(function(player)
if not locked then
door:Open()
elseif lockpick then
local success = math.random() < 0.5
if success then
locked = false
door:Open()
else
door.ProximityPrompt:SendPrompt("The lockpick breaks!")
end
end
end)
** You are now Level 1! **