#No Errors: ClickDetectored curtain system won’t open

1 messages · Page 1 of 1 (latest)

somber yoke
#

Will post code in 2 seconds

#

Explorer Pic:

#
local TS = game:GetService("TweenService")

local TI = TweenInfo.new(2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)

local open1 = TS:Create(script.Parent.Model.Main, TweenInfo.new(2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {Position = script.Parent.Open.Main.Position, Size = script.Parent.Open.Main.Size})
local close1 = TS:Create(script.Parent.Model.Main, TweenInfo.new(2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {Position = script.Parent.Close.Main.Position, Size = script.Parent.Close.Main.Size})

local open2 = TS:Create(script.Parent.Model.Main1, TweenInfo.new(2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {Position = script.Parent.Open.Main1.Position, Size = script.Parent.Open.Main1.Size})
local close2 = TS:Create(script.Parent.Model.Main1, TweenInfo.new(2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut), {Position = script.Parent.Close.Main1.Position, Size = script.Parent.Close.Main1.Size})

local size = script.Parent.Model.Main.Size
local debounce = false

if not script.Parent.OpenOnStart.Value then
    close1:Play()
    close2:Play()
end

script.Parent.Part.ClickDetector.MouseClick:Connect(function()
    if not debounce then
        debounce = true
        if script.Parent.Main.Size == size then
            close1:Play()
            close2:Play()
            wait(2)
            debounce = false
        else
            open1:Play()
            open2:Play()
            wait(2)
            debounce = false
        end
    end
end)
somber yoke
#

there isn’t an error

#

The curtains won’t open nor close

#

That’s what’s wrong

gaunt echo
somber yoke
#

I was going to use it then decided no too for some odd reason

#

I haven’t slept so 🤷🏻‍♂️

gaunt echo
#

your script is super long for no reason its kinda confusing ngl

somber yoke
#

If you got a better idea on how to do it, hit me

#

But don’t spoonfeed if you find the issue.

#

Please explain the issue so I can learn yk

gaunt echo
#
local TS = game:GetService("TweenService")

local TI = TweenInfo.new(2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.InOut)
local Main,Main2 = script.Parent.Close.Main,script.Parent.Close.Main1

local open1 = TS:Create(Main,TI, {Position = Main.Position, Size = Main.Size}) -- and so on
somber yoke
#

Main 1 and Main 2 are 2 different things

static pecan
#

if script.Parent.Main.Size change to if script.Parent.Model.Main.Size

gaunt echo
#

also i found why your script isnt working, you're tweening the position and size to the same size and position it is already in

#

Unless im reading the variables wrong

gaunt echo
somber yoke