Better way about this? Not working

Hi!


For some reason, this is not working. What’s wrong?

local parent = script.Parent
function e()
	parent.MaxVisibleGraphemes = 0
	local graph = parent.MaxVisibleGraphemes

		graph += 0.5
		
end


if script.Parent.Parent.Visible == true then
	e()
	end

I think it needs to be a local function e(). I’m not too sure, tell me if it works

1 Like


That didn’t work

Oh, is there any error in the output?


checking now, ui designer messed with something

did you spell “Time” correctly? and can we see your workspace when testing

It would work, doesn’t need to be a local function.
I can only suggest it isn’t working because the if statement doesn’t = true
Also since you’ve already created a variable for script.Parent you may as well use it in the if statement too:

local parent = script.Parent
function e()
	parent.MaxVisibleGraphemes = 0
	local graph = parent.MaxVisibleGraphemes

		graph += 0.5
		
end


if parent.Parent.Visible == true then
	e()
	else print("Not Visible!") end

Try that code and see if it prints the Not Visible message

Nothing.


It isn’t working when visible.

local Parent = script.Parent

function Test()
    local Graph = Parent.MaxVisibleGraphemes
    
    Graph += 0.5
end

if Parent.Parent.Visible == true then
    Test()
    print("Starting function?")
else
    print("Something happened")
end

Try this?

Nothing happened past here.

If this is a Server Script, you need to check the Server Side Logs instead of the Client Side
You should’ve gotten some sort of output regardless?

It’s a LocalScript, as you can see.

Not really but ok

Try this then?

local Parent = script.Parent

print("Is this script even working")

function Test()
    local Graph = Parent.MaxVisibleGraphemes
    
    Graph += 0.5
end

if Parent.Parent.Visible == true then
    Test()
    print("Starting function?")
else
    print("Something happened")
end

wait(30)
Test()

image Nothing past this

The Output looks like the function should’ve started, so it should’ve worked???

Confirm it 1 last time:

local Parent = script.Parent

print("Is this script even working")

function Test()
    print("Bruh")
    local Graph = Parent.MaxVisibleGraphemes
    
    Graph += 0.5
end

wait()
if Parent.Parent.Visible == true then
    Test()
    print("Starting function?")
else
    print("Something happened")
end

I saw the "bruh. Is something wrong with my function?

No, the script should’ve worked if it printed that? Try it again, I edited it a bit

i think i need some sort of loop in the Graph += function?

What exactly are you wanting to do in that function exactly? Slowly increase the MaxVisibleGraphemes property?

1 Like