Why doesn't my script work?

error:

  UIScale is not a valid member of TextButton "Players.Dozetopgg.PlayerGui.Chat.Frame.ChatBarParentFrame.Frame.BoxFrame.Frame.MessageMode"
function Animations.Buttons(Player)
	local Buttons = Player.PlayerGui:GetDescendants()
	for i, v in pairs(Buttons) do
		if v:IsA("GuiButton") and v.UIScale then
			local UIScale = v.UIScale
			v.MouseEnter:Connect(function()
				TweenService:Create(UIScale, info, {Scale = 1.15}):Play()
			end)
			v.MouseLeave:Connect(function()
				TweenService:Create(UIScale, info, {Scale = 1}):Play()
			end)
			v.MouseButton1Down:Connect(function()
				TweenService:Create(UIScale, info, {Scale = 0.85}):Play()
			end)
			v.MouseButton1Up:Connect(function()
				TweenService:Create(UIScale, info, {Scale = 1}):Play()
			end)
		end
	end
end

what is UIScale? And are you sure that the thing is indeed named that? Try printing v:GetChildren() to see whats there

UIScale is used to animate the buttons, but the error is that the Chat buttons are also counted, how can I fix this?

Um you could use an if statement to check if v has a UIScale, if so do the stuff with UIScale

but I already did it and it doesn’t work

if v:IsA("GuiButton") and v.UIScale then

try this:

if v:IsA("GuiButton") and v:FindFirstChild('UIScale') then

Explanation

My quess is that it was assuming v had a property or something called UIScale, so it checked for a property, I used FindFirstChild cause then it would look for a child
:3

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