alright so the script i got going here works on most doors but i have a set of i think 12 doors in a stable in my game and the ones in the stable dont work as intended they used to but now they like flip around about 3 times then get to their destination but thats only on one side the other side just doesnt do any flipping at all and just slides the door to where it supposed to go no rotation involved but the rest of the doors in the game work absolutely fine, here is a link to the game if you want to see what i mean but keep in mind you need a decent system to play it https://www.roblox.com/games/2973209508/Starter-RPG#!/about

Script:

local TweenService = game:GetService("TweenService")
local IsOpen = false
local FirstPos = script.Parent.FirstPos
local SecondPos = script.Parent.SecondPos
local Door = script.Parent.Door
local Event = script.Parent.InteractWithDoor

Event.OnServerEvent:Connect(function()
	if IsOpen == false then 
	local goal = {}
	goal.Position = SecondPos.Position
	goal.Orientation = SecondPos.Orientation
	local tweenInfo = TweenInfo.new(1.5, Enum.EasingStyle.Linear)
	local tween = TweenService:Create(Door, tweenInfo, goal)
	tween:Play()
	IsOpen = true
	elseif IsOpen == true then
		local tweeninfo = TweenInfo.new(1.5, Enum.EasingStyle.Linear)
		local goal = {}
		goal.Position = FirstPos.Position
		goal.Orientation = FirstPos.Orientation
		local tween = TweenService:Create(Door, tweeninfo, goal)
		tween:Play()
		IsOpen = false
	end
end)

also every door in the game has that same script in it from above

4 comments

0

This is not a solution to your question, but I'd like to offer advice on multi-similar scripts. Crete a linked source script so you only have to edit one script for every door.

0

Linked sources are deprecated.

0

didnt really think about using a module script just now getting into them myself but thanks tho