Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Sliding door script not working. Maybe I made a typo? [closed]

Asked by 6 years ago
Edited 6 years ago
local TweenService = game:GetService("TweenService")
local door1 = script.Parent:WaitForChild("door1")
local door2 = script.Parent:WaitForChild("door2")
local TweeningInformation = TweenInfo.new(
    0.5,
    Enum.EasingStyle.Linear,
    Enum.EasingDirection.Out,
    0,
    false,
    0
)
local door1Open = (CFrame = CFrame.new(-3.509, 6, -10.5))
local door2Open = (CFrame = CFrame.new(23, 6, -10.5))
local door1Close = (CFrame = CFrame.new(5.5, 6, -10.5))
local door2Close = (CFrame = CFrame.new(15, 6, -10.5))
local tween1Open = TweenService:Create(door1,tweeningInformation,door1Open)
local tween1Close = TweenService:Create(door1,tweeningInformation,door1Close)
local tween2Open = TweenService:Create(door2,tweeningInformation,door2Open)
local tween2close = TweenService:Create(door2,tweeningInformation,door2Close)

script.Parent.Detector1.Touched:Connect(function(hit)
    tween1open:Play()
    tween2open:Play()
    wait(2)
    tween1close:Play()
    tween2close:Play()
end)
script.Parent.Detector2.Touched:Connect(function(hit)
    tween1open:Play()
    tween2open:Play()
    wait(2)
    tween1close:Play()
    tween2close:Play()
end)

The doors are not sliding for some reason

0
is there a specific problem? theking48989987 2147 — 6y
0
like, does it teleport to a random spot, does it not tween, or something else? theking48989987 2147 — 6y
0
Sorry, the doors are not sliding for some reason. massivegem45 -12 — 6y
0
can you validate that it actually was hit? theking48989987 2147 — 6y
0
Add a condition in it. FrostyEmpire_1 0 — 6y

Closed as Non-Descriptive by IcyEvil, User#21908, piRadians, and DeceptiveCaster

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?