I'm developing a website thing to monitor banned players, so I can ban them across multiple places, but this happens


Thats my code, with http being HttpService,
and this is the error I am getting:
image

The error is happening on the last line of your code. You cant wrap just the line of code in a pcall, you also have to wrap it in a function like this:

local banned, errormsg = pcall(function(
http:GetAsync(req)
end)

sorry for not indenting code, my tab key exits out of the textbox

P.S. your post isnt properly formatted so I can’t tell exactly what is going on. Copy your code and press the </> button and paste it in there. It formats it to be easily readable. You can also say the line number the error happens on so that any other viewers can have more clarity as to where to look. It isnt as big of a problem here, but if you ever post larger segments of code then it can become a hassle super fast.

I didn’t realise you had to do that, I’m new to pcalls as i didn’t look them up before using them, thanks!

1 Like

Yes, pcalls require a function to run. You can either put a function name inside the parentheses or put a new function there depending on your needs

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.