local cash = script.Parent.Parent.Parent.Parent.Parent.Parent.Cash.Value
local text = script.Parent
if cash > 9999999 then
text.FontSize = 36
end
This doesnt give me any errors but it also doesnt work.
local cash = script.Parent.Parent.Parent.Parent.Parent.Parent.Cash.Value
local text = script.Parent
if cash > 9999999 then
text.FontSize = 36
end
This doesnt give me any errors but it also doesnt work.
Considering the amount of nines in your evaluation of cash's value, I assume you want the text's FontSize to increase if the cash's value is greater than or equal to a billion. Therefore, I simplified it into the code displayed below..
If the code below doesn't work, provide an output so that we know what exactly is the issue
local cash = script.Parent.Parent.Parent.Parent.Parent.Parent.Cash
local text = script.Parent
cash.Changed:connect(function()
if cash.Value > 1e7 then
text.FontSize = Enum.FontSize.Size36
end
end)
1e7represents the number1followed by7zeros, in other wordsone billion.
FYI: The output says: attempt to index field 'Text' (a string value)
'Text' ot 'text'..? Either way, perhaps AWESOMEnoob3 should consider checking that all variables are indeed existent.
My guess that you wan't the FontSize to change when the cash becomes more or less than 9999999
You can do this in a few different ways, but I'm not going to post them all:
Using While, do
local cash = script.Parent.Parent.Parent.Parent.Parent.Parent.Cash.Value
local text = script.Parent
while wait() do
if cash > 9999999 then
text.FontSize = 36
end
end
Using Changed function
local cash = script.Parent.Parent.Parent.Parent.Parent.Parent.Cash
local text = script.Parent
cash.Changed:connect(function()
if cash > 9999999 then
text.FontSize = 36
end
end)
Did not work. It's fine.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
I fixed my errors, if it doesn't work then reference "cash" differently (instead of cash = script.Parent.Parent.Parent.Parent.Parent.Parent.Cash.Value, do cash = script.Parent.Parent.Parent.Parent.Parent.Parent.Cash. and in if cash > 9999999 instead do if cash.Value > 9999999
ok ill try