why does my script only work on the first time?
local Button = script.Parent.Button
local TS = game:GetService("TweenService")
local Info = TweenInfo.new(0.3, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
local state = false
function onClick1()
if state == false then
local state = true
TS:Create(Button, Info, {BackgroundColor3 = Color3.new(1, 1, 1)}):Play()
else
local state = false
TS:Create(Button, Info, {BackgroundColor3 = Color3.new(0.141176, 0.141176, 0.141176)}):Play()
end
end
script.Parent.Button.MouseButton1Click:Connect(onClick1)