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

Why won't this set of bindable functions work correctly?

Asked by 10 years ago

`wait(1)

if script.Parent.Initialised.Value then

else script.Parent.Initialised.Value = true

local close = Instance.new("BindableFunction")
close.Parent = script.Parent
close.Name = "close"

function close.OnInvoke()
    return true
end 


local fclose = Instance.new("BindableFunction")
fclose.Parent = script.Parent
fclose.Name = "fclose"

function fclose.OnInvoke()
    print("Closing login")
    term = script.Parent.Parent.Parent.Parent
    print("Closed")
    term.running.Value = nil
    script.Parent:destroy()
end 

local open = Instance.new("BindableFunction")
open.Parent = script.Parent
open.Name = "open"

function open.OnInvoke()
    print("Opening Login")
    term = script.Parent.Parent.Parent.Parent
    np = script.Parent:clone()
    np.Parent = term.Screen.ScreenGUI.Screen.WorkingWindow
    term.running.Value = np
end

end`

Open is invoked first, successfully.

Afterwards, I have tried invoking fclose and close. Neither seem to work. No errors in prompt.

Answer this question