Help with Hovering Buttons in TweenService

I am trying to make an addition onto my script in Roblox for the menu. The addition is supposed to make it so when you hover over the buttons, the stroke expands to a .7 around the text. This is not working, can someone examine this script and tell me what I might be doing wrong?

NOTE: This is in a ModuleScript, there is another function in it that is being run. This function is not being run. I have checked the definitions, everything is in check there, the issue is the function.

Function:

function module.useButtons()
	
	local playstrokeTween = tweenService:Create(playStroke, TweenInfo.new(0.8), {Size = 0.7})
	local creditsstrokeTween = tweenService:Create(creditsStroke, TweenInfo.new(0.8), {Size = 0.7})
	local helpstrokeTween = tweenService:Create(helpStroke, TweenInfo.new(0.8), {Size = 0.7})
	
	playButton.MouseHover:Connect(playstrokeTween:Play())
	helpButton.MouseHover:Connect(helpstrokeTween:Play())
	creditsButton.MouseHover:Connect(creditsstrokeTween:Play())
	
end
2 Likes

This line(along with the two following) is the problem, because you want to connect MouseHover to a function, but playstrokeTween:Play() isn’t a function, it is instead what is returned from the Play function(which is nothing).

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.