MouseEnter won't work

Hi - I’ve not done developing in a while so this is probably a dumb mistake.

Mouse enter isn’t working - this is my script.

local h = 3

local playb = script.Parent.play
local shopb = script.Parent.shop
local invb = script.Parent.inventory
local textt = script.Parent.text

while true do
	wait(1)
	tweenservice:Create(playb, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = math.random(-h, h)}):Play()
	tweenservice:Create(shopb, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = math.random(-h, h)}):Play()
	tweenservice:Create(invb, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = math.random(-h, h)}):Play()
	tweenservice:Create(textt, TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = math.random(-h, h)}):Play()
end

playb.MouseEnter:Connect(function()
	print('hi')
	spin(playb)
end)

‘hi’ doesn’t get printed, ignore the spin function

Move the mouse enter connection before the while true do loop, currently it doesn’t run because the code gets stuck in the while loop and never lines the lines with mouse enter after the while loop.

Thats it! Thanks for helping me