#Ending failure
59 messages · Page 1 of 1 (latest)
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)
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))()
Thank you so much!
@sacred edgei made an indentation mistake
if it doesnt work its becauce
of
menu.MouseButton1Click:Connect(coroutine.wrap(Thefunction))()
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'
hm
replace the end with
menu.MouseButton1Click:Connect(Thefunction)
alr ill try
if it still errors,
paste each line one after the other
indentation errors is like:
for x in list:
print()
correct is
for x in list:
print()
make sure no mistakes like that exist
no i dont see any
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))()```
i told u, replace the last line with
menu.MouseButton1Click:Connect(Thefunction)
u didnt do the same thing i showed you for the rest
and theres an indentation error at menu.Visible
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?
to me it looks right
wait
no
?
mmmm what?
good now?
** You are now Level 6! **
i actually need to check, cause i havent done lua in a bit
idk where the ends go
Well after all im testing it tomorow
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
aight thanks alot
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)
Thanks!
Players.mikroprofin.PlayerGui.DarkFadingGUI.DarkFading.LocalScript:5: Expected identifier when parsing expression, go
@stoic barn
@stoic barn