#Ending failure

59 messages · Page 1 of 1 (latest)

stoic barn
#

cause indentation error

#

also, put the visible = false out of the loop

#

dont put stuff u do only once in the loop

#

also instead of wait do task.wait()

#

and when u call the function make it a coroutine, cause otherwise the script cant do anything else at the same time

#

coroutine.wrap(functionName)(parameters)

sacred edge
#

i dont really get it

stoic barn
#
local frame = script.Parent
local blur = game.Lighting.MenuBlur
local menu = script.Parent.Parent.Parent.StartMenu.TextButton

local Thefunction()
    menu.Visible = false
    blur.Size = 0
    for i = 1,100 do
        frame.BackgroundTransparency -= 0.01
        task.wait(0.01)
    task.wait(1)
    for i = 1,100 do 
        frame.BackgroundTransparency += 0.01
        task.wait(0.01)
        end            
    end
end)
menu.MouseButton1Click:Connect(coroutine.wrap(Thefunction))()
sacred edge
#

Thank you so much!

stoic barn
#

if it doesnt work its becauce
of
menu.MouseButton1Click:Connect(coroutine.wrap(Thefunction))()

sacred edge
#

oh i was just testing it

#

´´ Players.mikroprofin.PlayerGui.DarkFadingGUI.DarkFading.LocalScript:17: Expected <eof>, got 'end'´´

#

@stoic barn

#

help

#

Players.mikroprofin.PlayerGui.DarkFadingGUI.DarkFading.LocalScript:17: Expected <eof>, got 'end'

stoic barn
#

hm

stoic barn
sacred edge
#

alr ill try

stoic barn
#

if it still errors,
paste each line one after the other

sacred edge
#

what?

#

alr

stoic barn
#

indentation errors is like:
for x in list:
print()

correct is
for x in list:
print()

make sure no mistakes like that exist

sacred edge
#

hold on

#

alr it didnt work

#

it gets the same error

#
local blur = game.Lighting.MenuBlur
local menu = script.Parent.Parent.Parent.StartMenu.TextButton

menu.MouseButton1Click:Connect(Thefunction)
menu.Visible = false
blur.Size = 0
for i = 1,100 do
    frame.BackgroundTransparency -= 0.01
    task.wait(0.01)
    task.wait(1)
    for i = 1,100 do 
        frame.BackgroundTransparency += 0.01
        task.wait(0.01)
                    
        end            
    end
end)
menu.MouseButton1Click:Connect(coroutine.wrap(Thefunction))()```
stoic barn
stoic barn
stoic barn
sacred edge
#

ohhhhh

#

ill look for it tomoroe

sacred edge
#
local blur = game.Lighting.MenuBlur
local menu = script.Parent.Parent.Parent.StartMenu.TextButton

local Thefunction()
    menu.Visible = false
    blur.Size = 0
    for i = 1,100 do
        frame.BackgroundTransparency -= 0.01
        task.wait(0.01)
    task.wait(1)
    for i = 1,100 do 
        frame.BackgroundTransparency += 0.01
        task.wait(0.01)            
    end
end)
menu.MouseButton1Click:Connect(Thefunction)```
#

@stoic barn If ur awake is this somehow right?

sacred edge
#

?

stoic barn
#

you put an end un the second for loop

#

remove it

#

after task.wait

sacred edge
#

mmmm what?

stoic barn
#

at the bottom

#

you see 3 ends

#

remove the 3rd going up

bitter magnet
#

studio** You are now Level 6! **studio

stoic barn
#

i actually need to check, cause i havent done lua in a bit
idk where the ends go

sacred edge
#

Well after all im testing it tomorow

stoic barn
#
local frame = script.Parent
local blur = game.Lighting.MenuBlur
local menu = script.Parent.Parent.Parent.StartMenu.TextButton

local Thefunction()
    menu.Visible = false
    blur.Size = 0
    for i = 1,100 do
        frame.BackgroundTransparency -= 0.01
        task.wait(0.01)
    end
    task.wait(1)
    for i = 1,100 do 
        frame.BackgroundTransparency += 0.01
        task.wait(0.01)            
    end
end)

menu.MouseButton1Click:Connect(function() task.spawn(Thefunction) end)
#

thall work, ama look at how to make it async, so other funtions can run at the same time

sacred edge
#

aight thanks alot

stoic barn
#

i added an intermediate function, to make Thefunction a coroutine/asynchronous
you should do that in general for "blocking" functions
so your script can do other stuff

cause if you dont, everything else will wait for that function to be done before starting to do what they have to

for future reference, if you need to pass arguments/parameters, its like this:
task.spawn(Thefunction, arg1, arg2)

sacred edge
#

Players.mikroprofin.PlayerGui.DarkFadingGUI.DarkFading.LocalScript:5: Expected identifier when parsing expression, go

#

@stoic barn

sacred edge
#

@stoic barn