so basically, im making a little number line that tweens out and displays numbers for you to click on. a button activates this number line. 4 states:
visible
not visible
in (meaning the number line is ready to tween out and the numbers are ready to be displayed, just hasnt happened yet)
out (meaning the numberline has tweened out)
the states start out on not visible and in
when you click the button, it should become visible and then tween out, but that doesnt happen here
No errors produced, nothing happens.
local Out = {
["arrowleft"] = UDim2.new(0.04,0,0.5,0),
["arrowright"] = UDim2.new(0.953,0,0.5,0),
["linepos"] = UDim2.new(0.5,0,0.5,0),
["linesize"] = UDim2.new(0,425,0,3),
["one"] = true,
["two"] = true,
["zero"] = true,
["onefive"] = true,
["zerofive"] = true,
["containerpos"] = UDim2.new(0.5,0,0.85,0),
["containersize"] = UDim2.new(0,450,0,40)
}
local In = {
["arrowleft"] = UDim2.new(0.25,0,0.5,0),
["arrowright"] = UDim2.new(0.743,0,0.5,0),
["linepos"] = UDim2.new(0.5,0,0.5,0),
["linesize"] = UDim2.new(0,30,0,3),
["one"] = false,
["two"] = false,
["zero"] = false,
["onefive"] = false,
["zerofive"] = false,
["containerpos"] = UDim2.new(0.5,0,0.85,0),
["containersize"] = UDim2.new(0,50,0,40)
}
local state = "In"
local isVisible = false
local bar = script.Parent.scalecontainer
local button = script.Parent.container.timescale
local line = bar.line
local one = line.one
local two = line.two
local zero = line.zero
local zerofive = line.zerofive
local onefive = line.onefive
local arrowleft = bar.arrowleft
local arrowright = bar.arrowright
local Time = script.Parent.Time
local ts = game:GetService("TweenService")
local tiout = TweenInfo.new(0.5,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
local tiin = TweenInfo.new(0.5,Enum.EasingStyle.Sine,Enum.EasingDirection.In)
local rs = game:GetService("RunService")
local db = false
local visibilityState = false
function TweenOut()
ts:Create(arrowleft,tiout,{Position = Out["arrowleft"]}):Play()
ts:Create(arrowright,tiout,{Position = Out["arrowright"]}):Play()
ts:Create(line,tiout,{Position = Out["linepos"], Size = Out["linesize"]}):Play()
ts:Create(bar,tiout,{Position = Out["containerpos"], Size = Out["containersize"]}):Play()
task.wait(0.75)
one.Visible = Out["one"]
two.Visible = Out["two"]
zero.Visible = Out["zero"]
zerofive.Visible = Out["zerofive"]
onefive.Visible = Out["onefive"]
script.UIARCBarOpen.Parent = bar
script.UIARClineopen.Parent = line
script.UIARCarrowleftopen.Parent = arrowleft
script.UIARCarrowrightopen.Parent = arrowright
bar.UIARCbarclosed.Parent = script
line.UIARClineclosed.Parent = script
arrowleft.UIARCarrowleftclosed.Parent = script
arrowright.UIARCarrowrightclosed.Parent = script
end
function TweenIn()
ts:Create(arrowleft,tiin,{Position = In["arrowleft"]}):Play()
ts:Create(arrowright,tiin,{Position = In["arrowright"]}):Play()
ts:Create(line,tiin,{Position = In["linepos"], Size = In["linesize"]}):Play()
ts:Create(bar,tiin,{Position = In["containerpos"], Size = In["containersize"]}):Play()
task.wait(0.75)
one.Visible = In["one"]
two.Visible = In["two"]
zero.Visible = In["zero"]
zerofive.Visible = In["zerofive"]
onefive.Visible = In["onefive"]
script.UIARCbarclosed.Parent = bar
script.UIARClineclosed.Parent = line
script.UIARCarrowleftclosed.Parent = arrowleft
script.UIARCarrowrightclosed.Parent = arrowright
bar.UIARCBarOpen.Parent = script
line.UIARClineopen.Parent = script
arrowleft.UIARCarrowleftopen.Parent = script
arrowright.UIARCarrowrightopen.Parent = script
end
function visibilityToggle(visibility)
if visibility == false then
if state == "In" then
bar.Visible = false
arrowright.Visible = false
arrowleft.Visible = false
line.Visible = false
elseif state == "Out" then
TweenIn()
bar.Visible = false
arrowright.Visible = false
arrowleft.Visible = false
line.Visible = false
end
else
if state == "In" then
bar.Visible = true
arrowright.Visible = true
arrowleft.Visible = true
line.Visible = true
wait(0.75)
TweenOut()
elseif state == "Out" then
TweenIn()
bar.Visible = true
arrowright.Visible = true
arrowleft.Visible = true
line.Visible = true
task.wait(0.75)
TweenOut()
end
end
end
function ResetTime()
Time.Value = 5
end
while task.wait(1) do
Time.Value -= 1
end
rs.RenderStepped:Connect(function()
if Time.Value <= 0 then
TweenIn()
visibilityToggle(false)
ResetTime()
end
end)
button.Activated:Connect(function()
ResetTime()
if db == false then
db = true
if visibilityState == false then
visibilityToggle(true)
visibilityState = true
else
visibilityToggle(false)
visibilityState = false
end
task.wait(2)
db = false
end
end)
good luck deciphering my terrible code