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.
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) ```
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.
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.
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.
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
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
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)