Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Change font size?

I have a chat gui and when I chat, it adds the textlabel in the player inside a Frame. I want when I click this gui, the font changes to Arial.


a = script.Parent
clicked = a.MouseButton1Down

game.Players.PlayerAdded:connect(function(Player)

a.MouseButton1Down:connect(function(clicked)
	
	if clicked then
		
		game.Players.Player.PlayerGui.ChatGui.Frame:IsA("TextLabel").Font = "Arial"
		
		end
	end)
end)

Thanks for the help!

3 comments

0

What are you clicking?

0

A TextButton

0

Your problem is line 10; You are changing the TextLabel's Text itself; The 'IsA' method returns a Boolean (true, false, nil [Not sure about 'nil']), so, in the code, you are basically typing 'true.Font', and/or 'false.Font'. :P

1 answer

You need to use enumeration or 'enum' for short it's stupid but you must

a = script.Parent
--We don't need to define mousebutton
game.Players.PlayerAdded:connect(function(Player)
     a.MouseButton1Down:connect(function()
        game.Players.Player.PlayerGui.ChatGui.Frame:IsA("TextLabel").Font = Enum.Font.Arial
    end)
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.