Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Door hangs how to make it open smoothly?

I can create a door but as it opens it just hangs and u need to push it that it goes up again like the script is working but the door is moving for some secs and then stops only at the 2nd time it gets opened.

The script works still but the question is: How do I create a door that moves smooth and does NOT hang and CanCollide = true. If someone knows how to a BIG thx will be spoken!

local door = script.Parent.Parent:WaitForChild("Door")
local bodv = door:WaitForChild("BodyVelocity")
local Open = Instance.new("Sound", door)
Open.SoundId = "rbxassetid://130794579"
local Close = Instance.new("Sound", door)
Close.SoundId = "rbxassetid://130794614"

script.Parent.Touched:connect(function(hit)
	if hit ~= nil then
		if hit.Parent ~= nil then
			if hit.Parent:FindFirstChild("Humanoid") then
				if hit.Parent:FindFirstChild("Head") then
					if hit.Parent.Humanoid.Health > 0 then
						if game.Players:GetPlayerFromCharacter(hit.Parent) then
							local debounce = script.Parent.Parent.debounce.Value
							if not debounce then
								script.Parent.Parent.debounce.Value = true
								door.Anchored = false
								bodv.Velocity = Vector3.new(0,4,0)
								Open:Play()
								wait(6)
								bodv.Velocity = Vector3.new(0,-4,0)
								Close:Play()
								wait(6)
								bodv.Velocity = Vector3.new(0,0,0)
								door.Anchored = true
								wait(2)
								script.Parent.Parent.debounce.Value = false
							end
						end
					end
				end
			end
		end
	end
end)

2 answers

✓ Accepted answer

Why are you adding all these if statements you don't even need the if statement for the health

And what i recommend doing is doing a for loop for rotation. So something like this

for i = 0, 100, 1 do
	wait(0.1)
	script.Parent.Rotation = i
end
  1. it'll look veryyy smooth
  2. it's efficient

2 comments

0

But wouldn't you need to use Vector3.new(), define what axis you're changing (X,Y,Z)?

0

Why would u do this if u want your door sliding?

**Ugh? Maybe provide the script you're using **

Have a read of this document

1 comment

0

Nau I added the "Script" ur happy now? lol

This discussion is preserved as it was. New answers, comments, and votes are closed.