Assuming you’re using a different script for every single button, I would use a module to Tween. If you created a TweenHandler module, you could create one method to tween everything.
Setup
local TweenHandler = {}
--// Services
local TweenService = game:GetService("TweenService")
--// Functions
function TweenHandler:TweenPart(part) --// Tween given instance
local Tween = TweenService:Create(part, TweenInfo.new(--[[Whatever tweeninfo you want for all of them]]--, {--[[Whatever tween value you are using--]]
end
return TweenHandler
This module would fire the same exact tween for all of your buttons. As long as it’s required.
Usage
--// Modules
local TweenHandler = require(game.ReplicatedStorage.TweenHandler)
--// Constants
local CURRENT_PART = game.Workspace.p1
local NEXT_PART = game.Workspace.p2
--// Event handler
CURRENT_PART.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
CURRENT_PART:Destroy()
TweenHandler:TweenPart(NEXT_PART)
end
end)
This is a super rough example, but it should get the point across of how to make the fade you want.