So, I am making an elevator that has a fading gui when you click a button, just to clarify, this script isn't mine, but how do i get the clickdetector of every part in the folder?
local Frame = script.Parent
local Buttons = game.Workspace.Buttons:GetChildren()
local ClickDetector = -- i wanna get the clickdetector of many parts with the same name in a folder here
local TweenS = game:GetService("TweenService")
local Db = false
local FadeTime = 3
ClickDetector.MouseClick:Connect(function()
if not Db then
Db = true
TweenS:Create(Frame,TweenInfo.new(0.5),{BackgroundTransparency = 0}):Play()
task.wait(FadeTime)
TweenS:Create(Frame,TweenInfo.new(0.5),{BackgroundTransparency = 1}):Play()
task.wait(FadeTime)
Db = false
end
end)

3 comments
Alright thanks! I'll test it later!
Dont really get how i should put this in my script, sorry I'm a beginner. could you copy it and put it in it?
This is what i tried doing, look at the answers