very beginner self
user here, i am very confused
self
refers to the object that calls the function, so why does mine refer to the name of the function??
i call the function from a for loop:
for _,button in buttons:GetChildren() do
if button:IsA("ImageButton") then
button.Activated:Connect(function()
mainMenuModule:OnButtonClicked(camera, plr)
end)
button.MouseEnter:Connect(function()
OnButtonHoverEnter(button)
end)
button.MouseLeave:Connect(function()
OnButtonHoverLeave(button)
end)
end
end
and i receive it from a module thatâs inside replicated storage
function menuModule:OnButtonClicked(camera: Camera, plr: Player)
print(self)
-- these 2 variables are so stupid i hate them
local mainMenu: ScreenGui = self.Parent.Parent
local blink: Frame = mainMenu.Blink
blink.Visible = true
local tweenGoal = {BackgroundTransparency = 1}
local blinkTween = tService:Create(blink, blinkTweenParams, tweenGoal)
blinkTween:Play()
buttonEffects[self.Name](self, camera, plr)
blinkTween.Completed:Wait()
blinkTween:Destroy()
blink.Visible = false
end