script:
local tweenservice = game.TweenService
local right = game.Workspace.carshopdoors.carshoprightdoor
local left = game.Workspace.carshopdoors.carshopleftdoor
local tweenstyle = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0
)
local leftdoorclose = {
CFrame = CFrame.new(-187.32, 6.1, -1216.665),
Rotation = Vector3.new(0, 20, 0)
}
local rightdoorclose = {
CFrame = CFrame.new(-184.71, 6.1, -1209.494),
Rotation = Vector3.new(0, 20, 0)
}
local leftdooropen = {
CFrame = CFrame.new(-184.764, 6.1, -1221.919),
Orientation = Vector3.new(0, -70, 0)
}
local rightdooropen = {
CFrame = CFrame.new(-179.131, 6.1, -1206.973),
Orientation = Vector3.new(0, -70, 0)
}
local leftclose = tweenservice:Create(left,tweenstyle,leftdoorclose)
local rightclose = tweenservice:Create(right,tweenstyle,rightdoorclose)
local leftopen = tweenservice:Create(left,tweenstyle,leftdooropen)
local rightopen = tweenservice:Create(right,tweenstyle,rightdooropen)
local active = true
script.Parent.Touched:Connect(function()
if active then
active = false
print("working")
leftopen:Play()
rightopen:Play()
wait(2)
active = true
end
end)
sometimes it goes like this https://imgur.com/a/dCggpAZ
other times it goes like this https://imgur.com/a/iFDhsuG
how can i make it always work as https://imgur.com/a/iFDhsuG

7 comments
but here is the problem for me, whenever i use CFrame.Angles my part always get moved to the spawn where the position is 0,0,0 and thats why i use Orientation
Have you tried my code?
just got home to try it and it works thanks
now my question is, how can i reverse this
do you want the doors to close automatically?
i made them fully work the way i want both ways and with your script it just breaks as soon as i use the other activator
if the other activator is in the same script, you would use leftclose:Play() and rightclose:Play(). Similiary in other script, just remember when doors were at the start of the game (memorize CFrame) and just play tween. It will GUARANTEE to tween to where it was at the start of the game and with proper orientation.