Im sure people will disagree with me… but I am going to say it anyway…
Its personal preference… Using 1 script has its benefit such as updating so you don’t have to go through every single script but if you have to scroll through several thousand lines it has the same effect.
One way I personally use often… is to go a more a simple way and have values inside of each button and let them tell me what it needs to do… (Not to mention I don’t care for module scripts at all)
A easy example of this that I done was with a dev product/gamepass gui. With this I have 1 script inside and 2 values inside of each button that tells me what I need to do… The 2 values are labeled Product(Bool) and ID(For the product/gamepassID) of course…
This makes this very easy and simple to either add more or edit the current one… Instead of having to go through 10 or so gamepasses, I can go through a 60 line script.
https://gyazo.com/ab7a7879bfe61c7aeeab6f48eb1e1eb1
With just a little bit of simple code through a loop, you can easily go through all of the items and control them simultaneously
for i,v in pairs(script.Parent.Money:GetChildren()) do
v.Activated:Connect(function()
if v:FindFirstChild("Product") then
MPS:PromptProductPurchase(game.Players.LocalPlayer, v.ID.Value)
elseif not v:FindFirstChild("Product") then
if not MPS:UserOwnsGamePassAsync(game.Players.LocalPlayer.UserId, v.ID.Value) then
MPS:PromptGamePassPurchase(game.Players.LocalPlayer, v.ID.Value)
end
end
end)
v.MouseEnter:Connect(function()
for b,o in pairs(v:GetChildren()) do
if not o:IsA("NumberValue") and not o:IsA("BoolValue") then
local position = UDim2.new(-3.5,0,o.Position.Y.Scale, 0)
o:TweenPosition(position, "In", "Quad", .2)
spawn(function()
wait(2)
local position2 = UDim2.new(5,0,o.Position.Y.Scale, 0)
o:TweenPosition(position2, "In", "Quad", .2)
end)
end
end
end)
v.MouseLeave:Connect(function()
for b,o in pairs(v:GetChildren()) do
if not o:IsA("NumberValue") and not o:IsA("BoolValue") then
local position = UDim2.new(5,0,o.Position.Y.Scale, 0)
o:TweenPosition(position, "Out", "Quad", .2)
end
end
end)
end
https://gyazo.com/8650319eea01a4bb9295cbf37fbc12f2
I have gotten bad about using this method just because of the fact that is quick. My friends that program go to look at this wondering what I done… This method is a bit more complicated then the conventional method but works better by far!
Hope this has helped you!