You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I’m not sure if this is possible, but is it possible to use 1 script to detect all button presses without stacking multiple functions -
What is the issue? Include screenshots / videos if possible!
I don’t want to clutter the script/add 1 script per button, because there are so many, so I thought of this possibility -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
No one else seemed to have this question, so I decided to make my own
local player = game.Players.LocalPlayer
local material = script.Parent
local makeStation = nil
local properties = script.Parent
local partSelected = properties.partSelected
local function findMakeStation()
for _, v in ipairs(workspace:GetChildren()) do
if v:IsA("Model") and v.Name == "makeStation" and v:FindFirstChild(player.Name) then
makeStation = v
end
end
end
material.Activated:Connect(function()
findMakeStation()
local part = makeStation.partFolder:FindFirstChild(partSelected.Value)
makeStation.partFolder.propertyChanger.Material:FireServer(part, script.Parent.Text)
end)
This is the script, and instead of saying “script.Parent.Activated”, it says “[All buttons here].Activated”.
Is this possible?