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

My self opening door script isnt working how can I fix it?

Asked by
ym5a 52
3 years ago
Edited 3 years ago
if game.Workspace.open.Value == true then
    local tweenService = game:GetService("TweenService")
    local part = game.Workspace.Model.doors.door1


    local tweeningInformation =  TweenInfo.new(

        2,
        Enum.EasingStyle.Linear,
        Enum.EasingDirection.In,
        1,
        false,
        0)

    local tweeningProperties = {


        ["Position"] = Vector3.new(-17.204, 6.759, 27.608)

    }


    local Tween = tweenService:Create(part,tweeningInformation,tweeningProperties)

    Tween:Play()

    print("should be done by now.....")



game.Workspace.open.Value = false
wait(5)

    local tweenService = game:GetService("TweenService")
    local part = game.Workspace.Model.doors.door1


    local tweeningInformation =  TweenInfo.new(

        2,
        Enum.EasingStyle.Back,
        Enum.EasingDirection.Out,
        1,
        false,
        0)

    local tweeningProperties = {


    ["Position"] = Vector3.new(-10.132, 6.759, 27.608)

    }


    local Tween = tweenService:Create(part,tweeningInformation,tweeningProperties)

    Tween:Play()

    print("closed")

end

Boolean value of Open is successfully set to true.....but the door doesnt open If you need more info let me know, there are detectors around the door that will make the value true, then the door opening script will set it back to before closing the door? am I supposed to add an else statement or put "do" after then? please help I think its running repeatedly or something Nothing happens, nothing prints and no errors

0
https://prnt.sc/1kh802k the success script for the touch function works, so its not a problem witht that ym5a 52 — 3y
0
Is this if statement ran only once as shown here? deeskaalstickman649 475 — 3y
0
If open's value = true it will run then set it to false and close (havent scripted that yet) @deeskaalstickman649 ym5a 52 — 3y
0
I scripted that part and it says the script ran , ("closed" print at the end) well but the door doesnt open ym5a 52 — 3y
View all comments (2 more)
0
I put newly edited script in the question ym5a 52 — 3y
0
Can you put an Else in the If statement and put a print in the Else statement? If the print gets activated that means the server thinks the open Value is false. Tell me if it does that. DocGooseYT 110 — 3y

Answer this question