local BookOneCon = script.BOOKS_FOLDER.Value.BOOK_ONE.PROMPT.Triggered:Connect(function()
script.UPDATE_CLUES:FireAllClients("A", ONE)
BookOneCon:Disconnect()
end)
BookOneCon:Disconnect(), the function is underlined orange
local BookOneCon = script.BOOKS_FOLDER.Value.BOOK_ONE.PROMPT.Triggered:Connect(function()
script.UPDATE_CLUES:FireAllClients("A", ONE)
BookOneCon:Disconnect()
end)
BookOneCon:Disconnect(), the function is underlined orange
The variable isn’t seem within the scope.
local BookOneCon; BookOneCon = script.BOOKS_FOLDER.Value.BOOK_ONE.PROMPT.Triggered:Connect(function()
script.UPDATE_CLUES:FireAllClients("A", ONE)
BookOneCon:Disconnect()
end)
Define the variable first, then use it
Alternatively, you can just use RBXScriptSignal:Once
to disconnect the event once it fires
If you want to disconnect from inside of the function then you have to declare beforehand.
Like this:
local BookOneCon
BookOneCon = script.BOOKS_FOLDER.Value.BOOK_ONE.PROMPT.Triggered:Connect(function()
script.UPDATE_CLUES:FireAllClients("A", ONE)
BookOneCon:Disconnect()
end)
Oh yes i forgot bout that. thanks
You defined the variable twice, don’t put local
in front of the definition:
o- o that well it didnt actually matter i found out