#Is it possible to apply one function to 4 buttons?
11 messages · Page 1 of 1 (latest)
I'm a begginer and that's why I'm asking out here
the whole script looks like that: ```lua
-- // Services & Locals \ --
local tweenService = game:GetService("TweenService")
local bg = script.Parent.Parent.Background
-- // Folders \ --
local buttonsFolder = bg:WaitForChild("Buttons")
local pagesFolder = bg:WaitForChild("Pages")
-- // Buttons \ --
local playButton = buttonsFolder:WaitForChild("PlayButton")
local settingsButton = buttonsFolder:WaitForChild("SettingsButton")
local creditsButton = buttonsFolder:WaitForChild("CreditsButton")
local changelogButton = buttonsFolder:WaitForChild("ChangelogButton")
-- // Tweens \ --
-- // Functions \ --
local function regButton(Button: TextButton)
local tween = tweenService:Create(Button, TweenInfo.new(0.4), {TextSize = 35, TextColor3 = Color3.fromRGB(203, 203, 203)}):Play()
end
-- // Registering Buttons \ --
playButton.MouseEnter:Connect(regButton)
settingsButton.MouseEnter:Connect(regButton)
creditsButton.MouseEnter:Connect(regButton)
changelogButton.MouseEnter:Connect(regButton)
eh yes its posibble
can you explain what I did wrong here?