So recently I’ve been trying to make it so when I click a GUI button, a part tweens and a part changes color. So far I’ve tried this (and MouseButton1Click) but so far nothing has worked and there’s no errors. If anybody can help me that would be amazing! Thank you!
-- local door = script.Parent.Door
local btn = game.StarterGui.ComputerGUI.Frame.ImageLabel["Turn On"]
local doorCFrame = door.CFrame
local doorendCFrame = script.Parent.DoorEnd.CFrame
local TweenService = game:GetService("TweenService")
local TweenInformation = TweenInfo.new(
0.50,
Enum.EasingStyle.Sine,
Enum.EasingDirection.InOut,
0,
false,
0
)
local TweenA = TweenService:Create(door, TweenInformation, {CFrame = doorendCFrame})
local Tweenb = TweenService:Create(door, TweenInformation, {CFrame = doorCFrame})
local DoorOpen = false
btn.MouseButton1Up:Connect(function()
script.Parent.Industrial_Light.Light.BrickColor = BrickColor.new("Bright green")
script.Parent.Industrial_Light.Light2.BrickColor = BrickColor.new("Medium green")
script.Parent.Industrial_Light.Light2.PointLight.Enabled = true
if DoorOpen == false then
DoorOpen = true
TweenA:Play()
script.Parent.Part:Destroy()
end
end)