Script problem with ProximityPrompt Door

Just from a quick glance it might be the number you’re increasing it by is too low. Try either making the number bigger or increasing the loop size. Assuming you don’t know what that means you can try changing > for i = 1,22 < change 22 to a higher number or where it says

Hinge.CFrame*Cframe.Angles(0, math.rad(4) < you can try changing that 4 to a higher number too. Of course thats just from a quick glance and I would suggest putting a few prints in between lines to make sure everything is working as intended.

Thank you again it works better and better but my script still have a problem : image


The door refused to close, it goes back to opened mode

Okokok let me see.

local Proxy = script.Parent.Door.ProximityPrompt
local Hinge = script.Parent.Hinge
local opened = false

Proxy.Triggered:Connect(function()
     if Proxy.ActionText == 'Opened' and opened == false then
          for i = 50, 85 do
               script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(4), 0))
               wait()
               Proxy.ActionTest = 'Closed'
               print('The door is closed')
          end
       elseif Proxy.ActionTest == 'Closed' and opened == true then
            for i = 50, 85 do
                 script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(-4), 0))
                 wait()
                 Proxy.ActionTest = 'Opened'
                 print('The door is opened')
              end
       end
       opened = not opened
end)

Omg that took so long to type xd. Please for everyones sake just post the code next time itll be so much easier to help. But try this and see if this does anything. Also fix any grammar issues in the code if one should appear. and by post the code I mean put it in here instead of a screen shot

Okay thank you for trying to help me.
I fixed the word ActionTest in ActionText but the door doesn’t work anymore.
My output said nothing about the script.
Here your script that I fixed in sentence.
If you need my script in letter, please ask me, I didn’t expect you needed it.

local Proxy = script.Parent.Door.ProximityPrompt
local Hinge = script.Parent.Hinge
local opened = false

Proxy.Triggered:Connect(function()
     if Proxy.ActionText == 'Opened' and opened == false then
          for i = 50, 85 do
			script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(4), 0))
			wait()
			Proxy.ActionText = 'Closed'
			print('The door is closed')
			end
		elseif Proxy.ActionText == 'Closed' and opened == true then
		for i = 50, 85 do
			script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(-4), 0))
			wait()
			Proxy.ActionText = 'Opened'
			print('The door is opened')
			end
		end
	opened = not opened
end) ```

Here my original script which works better than your :

local Proxy = script.Parent.Door.ProximityPrompt
local Hinge = script.Parent.Hinge
local opened = false

Proxy.Triggered:Connect(function()
	if Proxy.ActionText == "Opened" and opened == false then
		opened = true
		for i = 50, 85 do
			script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(4), 0))
			wait()
			Proxy.ActionText = "Closed"
			print("The Door is closed")
		end
	end
	opened=false
	for i = 50, 82 do
		script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(-4), 0))
			wait()
		    Proxy.ActionText = "Opened"
		    print("The Door is opened")
	end
end) ```
1 Like

Okok sorry I’m like trying to figure this out, cuz I just got back to roblox and this is a whole new service lmao. Been reading around some other posts and heres a few I have to offer.

Prompts+ - Easily customize ProximityPrompts - Resources / Community Resources - Roblox Developer Forum
Proximity Prompt Studio Beta - Updates / Announcements - Roblox Developer Forum

Like I would have to spend some time seriously playing around with this service and I don’t wanna just keep giving you dead ends. Like idk if its still in beta and you have to have the beta service enabled, idk if its like a click detector thing or if theres multiple uses. Theres just so much to cover in this. One thing that does stand out is in every proximity prompt function they have a player argument inside so that could just be the only thing thats missing. To be honest prior before this service the go to thing would be run service > Theres plenty of videos all over youtube on that and it would probably be way easier to go with run service than trying to figure this out. Of course thats just me > I’m more surprised no one else has come to try and help yet q.q Sorry man whish I could do more for ya.

Thank you for spending your time for trying to help me.
I’ll continue to search.
I don’t think I’ll find a Youtube video showing the solution to my problem but I’ll continue to search.

Maybe it’s your loop? try using tweenservice

Have you read my script? I’m using TweenService and that’s not the actual problem. Actually I can open the door, but when the door is opened, it doesnt want to be closed.

Where are you using tweenservice?

Sorry I forgot to mention I’m using CFrame, I don’t think I need to use TweenService, I’m searching a way to end my loop when the door is opened.

When the door is opened,you can use break in the loop.

Can you tell me which part of the script I should modify for this?

for i = 50, 85 do
script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(-4), 0))
wait()
Proxy.ActionText = ‘Opened’
if script.Parent.PrimaryPart.CFrame == “the cframe you want” then
break
end
end

Um… when i tried your script the door flew everywhere.

Not for me. I used the line of script that you gave me, and the door still continue to use the bad CFrame after being in “Opened” mode

Here the actual script with your line added :

local Proxy = script.Parent.Door.ProximityPrompt
local Hinge = script.Parent.Hinge
local opened = false

Proxy.Triggered:Connect(function()
	if Proxy.ActionText == "Closed" and opened == false then
		opened = true
		for i = 50, 85 do
			script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(4), 0))
			wait()
			Proxy.ActionText = "Opened"
			print("The Door is opened")
		end
	end
	   opened = false
	for i = 50, 85 do
		script.Parent:SetPrimaryPartCFrame(Hinge.CFrame*CFrame.Angles(0, math.rad(-4), 0))
		wait()
		Proxy.ActionText = "Closed"
		if script.Parent.SetPrimaryPartCFrame == (Hinge.CFrame*CFrame.Angles(0, math.rad(4), 0)) then
			break
		end
		end
	end)

The door still continue to go back in “Opened” mode, your break does nothing

Alright i think im on the right track. it’s opening but then the text disappears.
Current script:

local Proxy = script.Parent.Door.ProximityPrompt
local Hinge = script.Parent.Hinge

local TS = game:GetService(“TweenService”)

local targetOpenCFrame = Hinge.CFrame * CFrame.Angles(0, math.rad(90) ,0)
local defaultCloseCFrame = script.Parent.Door.CFrame

local openTween = TS:Create(script.Parent.Door, TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0), {CFrame = targetOpenCFrame})
local closeTween = TS:Create(script.Parent.Door, TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0), {CFrame = defaultCloseCFrame})

local opened = false

Proxy.Triggered:Connect(function()
if opened == false then
opened = true
openTween:Play()
Proxy.ActionText = “Open”
print(“The Door is open”)
elseif opened == true then
opened=false
closeTween:Play()
Proxy.ActionText = “Closed”
print(“The Door is closed”)
end
end)

PS: Sorry i dont know how to embed it

I tested your script and it broke the door after the door was opened. To write a code in lua mod. You may use lua
image

Yeah thats the problem right now also thanks for the tip