#the bindable function doesn't yield the code

1 messages · Page 1 of 1 (latest)

rapid frost
#

i want the first script to yield in the line local ItemsDeleted = RemoveItem:Invoke(ExitFrame) until it returns a table from the second script (both are module scripts required by a local script btw)

ornate plover
#

You could try putting
while itemsdeleted == nil do
Task.wait()
End

#

Since the client will send back an empty table if they dont delete anything when they are finished, the while statement won't block the code from continuing

ornate plover
rapid frost
#

it didn't work although what you said makes sense

ornate plover
rapid frost
ornate plover
#

Try doing
Local itemsdeleted = nil
Itemsdeleted = invoke

drowsy crescentBOT
#

studio** You are now Level 5! **studio

rapid frost
ornate plover
#

Even with the loop huh that's weird

rapid frost
#

i think that the return doesnt even reach the first script

ornate plover
#

Yea i just saw it now

#

I think your server side invoke is supposed to be invokeclient

#

I don't see anything on just invoke

rapid frost
#

i am using a bindable function which means that it allows 2 local scripts to interact with each other

#

so the :invoke() is correct

ornate plover
#

Ah wait it might be because it needs an oninvokd

#

RemoveItem is the bindable function right?

ornate plover
#

So on the other script you need to have
RemoveItem.onInvoke = removebuild

rapid frost
ornate plover
#

Welp if you already have that then

#

Guess let's check if the removebuild function is actually being called

rapid frost
#

i just read this...

#

i think i have to have the return on the function itself

ornate plover
#

I'm thinking it's running the removebuild function and once it sets up the connections, it doesn't wait and just sends back nil

#

So maybe have a while statement at the end of removebuild

ornate plover
#

While isremoving == true then
Task.wait()
End
Return itemsdeleted

#

You can probably remove the while in the first script

rapid frost
#

IT WORKED

#

OMG THANK U

ornate plover
#

Np

#

We both learned something