Oh yes sure. Here it is:
local ClosedC0 = CFrame.new(4.29153442e-06, 3.81469727e-06, 1.9499979, 1, 0, 0, 0, 1, 0, 0, 0, 1)
local OpenC0 = CFrame.new(4.29153442e-06, -0.846243143, 3.2851181, 1, 0, 0, 0, 0.579398692, -0.815044284, 0, 0.815044284, 0.579398692)
local stove = script.Parent:WaitForChild("Stove")
local buttons = stove:WaitForChild("Buttons")
local Elements = stove:WaitForChild("HeatingElements")
local lid = script.Parent.Oven.Body.Lid
for _, v in pairs(buttons:GetChildren()) do
if v.Name == "Button1" then
local CD = v.Click
local Box = v.Box
CD.MouseHoverEnter:Connect(function()
Box.Visible = true
end)
CD.MouseHoverLeave:Connect(function()
Box.Visible = false
end)
CD.MouseClick:Connect(function()
if Elements.E1.State.Value == false then
Elements.E1.State.Value = true
Elements.E1.Material = Enum.Material.Neon
Elements.E1.BrickColor = BrickColor.new("Really red")
elseif Elements.E1.State.Value == true then
Elements.E1.State.Value = false
Elements.E1.Material = Enum.Material.Metal
Elements.E1.BrickColor = BrickColor.new("Smoky grey")
end
end)
elseif v.Name == "Button2" then
local CD2 = v.Click
local Box2 = v.Box
CD2.MouseHoverEnter:Connect(function()
Box2.Visible = true
end)
CD2.MouseHoverLeave:Connect(function()
Box2.Visible = false
end)
CD2.MouseClick:Connect(function()
if Elements.E2.State.Value == false then
Elements.E2.State.Value = true
Elements.E2.Material = Enum.Material.Neon
Elements.E2.BrickColor = BrickColor.new("Really red")
elseif Elements.E2.State.Value == true then
Elements.E2.State.Value = false
Elements.E2.Material = Enum.Material.Metal
Elements.E2.BrickColor = BrickColor.new("Smoky grey")
end
end)
elseif v.Name == "Button3" then
local CD3 = v.Click
local Box3 = v.Box
CD3.MouseHoverEnter:Connect(function()
Box3.Visible = true
end)
CD3.MouseHoverLeave:Connect(function()
Box3.Visible = false
end)
CD3.MouseClick:Connect(function()
if Elements.E3.State.Value == false then
Elements.E3.State.Value = true
Elements.E3.Material = Enum.Material.Neon
Elements.E3.BrickColor = BrickColor.new("Really red")
elseif Elements.E3.State.Value == true then
Elements.E3.State.Value = false
Elements.E3.Material = Enum.Material.Metal
Elements.E3.BrickColor = BrickColor.new("Smoky grey")
end
end)
elseif v.Name == "Button4" then
local CD4 = v.Click
local Box4 = v.Box
CD4.MouseHoverEnter:Connect(function()
Box4.Visible = true
end)
CD4.MouseHoverLeave:Connect(function()
Box4.Visible = false
end)
CD4.MouseClick:Connect(function()
if Elements.E4.State.Value == false then
Elements.E4.State.Value = true
Elements.E4.Material = Enum.Material.Neon
Elements.E4.BrickColor = BrickColor.new("Really red")
elseif Elements.E4.State.Value == true then
Elements.E4.State.Value = false
Elements.E4.Material = Enum.Material.Metal
Elements.E4.BrickColor = BrickColor.new("Smoky grey")
end
end)
end
end
local TS = game:GetService("TweenService")
local info = TweenInfo.new(2, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out, 0, false, 0)
local OpenGoal = {
C0 = OpenC0
}
local CloseGoal = {
C0 = ClosedC0
}
local open = TS:Create(lid, info, OpenGoal)
local close = TS:Create(lid, info, CloseGoal)
local tweenplaying = false
function handleDoor(state)
if not tweenplaying and state.Value == "Closed" then
tweenplaying = true
open:Play()
wait(2)
state.Value = "Open"
tweenplaying = false
elseif not tweenplaying and state.Value == "Open" then
tweenplaying = true
close:Play()
wait(2)
state.Value = "Closed"
tweenplaying = false
end
end
lid.Parent.Parent.OvenHandle.Click.MouseHoverEnter:Connect(function()
lid.Parent.Parent.OvenHandle.Box.Visible = true
end)
lid.Parent.Parent.OvenHandle.Click.MouseHoverLeave:Connect(function()
lid.Parent.Parent.OvenHandle.Box.Visible = false
end)
lid.Parent.Parent.OvenHandle.Click.MouseClick:Connect(function()
handleDoor(lid.Parent.Parent.OvenHandle.State)
end)