Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Change font size?

Asked by
FiredDusk 1466 Moderation Voter
8 years ago

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!

0
What are you clicking? Potlon 35 — 8y
0
A TextButton FiredDusk 1466 — 8y
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 TheeDeathCaster 2368 — 8y

1 answer

Log in to vote
1
Answered by
NotSoNorm 777 Moderation Voter
8 years ago

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)

Ad

Answer this question