v.Activated wont print

So I made some UI, and everything else about it works, however v.Activated will not. The code and video result is provided below:

local UI = script.Parent
local TweenService = game:GetService("TweenService")
local MarketPlaceService = game:GetService("MarketplaceService")

local tweenInfo = TweenInfo.new(0.05, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)

local scaleUp = { Size = UDim2.new(1.184, 0, 0.089, 0) }
local scaleNormal = { Size = UDim2.new(1.021, 0, 0.077, 0) }

for _, v in pairs(UI:GetChildren()) do
	if v:IsA("TextButton") then
		v.MouseEnter:Connect(function()
			local tween = TweenService:Create(v, tweenInfo, scaleUp)
			tween:Play()
			script.Hover:Play()
		end)

		v.MouseLeave:Connect(function()
			local tween = TweenService:Create(v, tweenInfo, scaleNormal)
			tween:Play()
		end)
		
		v.Activated:Connect(function()
			print("CLicked")
		end)
	end
end

You sure its a local script?
image

Activated is a compitelly different property than you think
Activated is responsible for .Active property as far as i remember while you are looking for a click event

You are probably looking for mouse events like MouseButton1Click and TouchTap

Did you watch the video? You can clearly see its a localscript

please read my post again
char limit

Yes its a local script, also Activated works perfectly fine when I put it in a separate UI with a new button as shown below.

just use https://create.roblox.com/docs/reference/engine/classes/TextButton#MouseButton1Click or https://create.roblox.com/docs/reference/engine/classes/TextButton#TouchTap
Never seen anyone using activated anyway

It might be because of something else that is caused by the click of a button. Are there any other scripts that are affected by the button activation?

Active property could be off also
It has to be on

1 Like

I ended up just using MouseButton1Click, thank you

Make sure that you make it mobile-friendly as well though.

Activated doesn’t have proper documentation as of now sadly.
So you should consider binding function to both https://create.roblox.com/docs/reference/engine/classes/TextButton#MouseButton1Click and https://create.roblox.com/docs/reference/engine/classes/TextButton#TouchTap

.Activated is like both of them there’s no need to use 2 events

Activated didn’t work for him, and he decided against using it.

I ended up getting .Activated to work, because as Yarik said, if the Active property is off, it wont work, and I accidentally turned off Active, so I switched back to Activated lol

2 Likes

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