Wrapping :SetAsync in a pcall

Hey, all!

I’m quite new to pcalls and I’m struggling quite a lot to figure out how to wrap :SetAsync in a pcall and repeat it if the request fails. I’m getting an error and I believe it’s because I haven’t done the pcall properly, so any help with how to fix this would be greatly appreciated. :blush:

Thanks! :two_hearts:

Disregard this post, I believe I’ve done this correctly now.

Is this correct and if so, are there any other ways I can improve the efficiency of this code? :slight_smile:
image

You can do it like this

successVar, response = pcall(banData.SetAsync, banData, player.Name, dataTable)
1 Like