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

Changing color of text in function?

Asked by 5 years ago
Edited 5 years ago

So, I made a Text Box and when you press enter, the text you entered will then display above your head. The problem is, it works.... BUT when I try to add script to make it change color, font, and remove the border pixel, it doesn't work. I've looked into how to fix this but I still have no clue what to do. Thanks.

01script.Parent.FocusLost:connect(function(enter)
02    if enter then
03        v = game.Players.LocalPlayer
04        for a, mod in pairs(v.Character:children()) do
05            if mod:findFirstChild("NameTag") then
06                v.Character.Head.Transparency = 0 mod:Destroy()
07            end
08        end
09 
10        local char = v.Character
11        local mod = Instance.new("Model", char)
12        mod.BorderPixelSize = 0
13        mod.Font = "Cartoon"
14        mod.BackgroundColor3 = ("246, 197, 255")
15        mod.Name = script.Parent.Text
View all 28 lines...

2 answers

Log in to vote
0
Answered by
cegberry 432 Moderation Voter
5 years ago

Are you sure a model contains the following properties?:

BorderSizePixel Font BackgroundColor

You may want to recheck your code to make sure it references a TextLabel, not an Model

Ad
Log in to vote
-1
Answered by 5 years ago

local mod = Instance.new("Model", char) local mod is model, not text box

mod.BorderPixelSize = 0 mod.Font = "Cartoon"

you're trying to change font and border pixel size of model?

Answer this question