Why is studio ignoring my code?

Can you try printing plr.Name to make sure it is actually what you think at that point?

This likely won’t solve your problem, but I’d recommend using UserId instead of name, as name can change at any time from the player changing their username.

@0xBAADF00D if you read above you can see I tried something like that.

Juuuust in case, add print(plr.Name == “Recallity”) after the Points-print. Otherwise… get an exorcist?

I also did add print(plr.Name) and it was Recallity.


@NoCollider Yes actually, funny thing is, once I re-add the Http:PostAsync requests it voids any changes I’ve made to the script.

Oops, I skimmed too much. Yep, get an exorcist.

EDIT: I see you deleted the Discord webhook. Shame. :wink:

You don’t have to get angry. I was just saying it’s good practice to keep using UserId instead of name.

Firstly, pcall your PostAsync, and save the return value (for all HttpService YieldFunction calls you have in your game). If that’s failing, it would be helpful to know why. Secondly, what other HttpService calls do you make? Are you sure one isn’t exceeding any of the usage limits, and you’re not trying to hit any Roblox domains with them, right? I’m wondering why you construct a URL to a user’s profile image, for example. Thirdly, have you debugged your webserver code? Is it using a REST API, and if so, have you used a REST client to do simple tests on it, make sure it’s not hanging and failing to respond to the POST?

  1. I usually do pcall, but because I was adjusting it so much, I wanted it to throw the error as plainly as possible without the hassle of adding the extra 3 lines for the pcall.

  2. (a) I use a Discord API I made and I know for a fact it’s not going over the limit because it only fires when the queue has an entry, the queue only gets an entry when the player says something, then a while loop checks every second to post one of the entries. [b] When I test, I’m not talking to myself in-game, meaning that nothing is being sent. [c] If I was going over the limit it would throw an error saying “TOO MANY REQUESTS.” [d] I’ve done research on the HTTP limits and made sure I’m in the clear.

  3. I grab the user image because…
    image

  4. I’m not that familiar with the HTTP service so I don’t really know what REST is. The only problem I see with the problems you are suggesting is that it doesn’t even throw any kind of error, nor does it print the things before the request.

Sorry if I seem rude, I’m just trying to get as much of my problem across without much filter. It’s also stressing me out a bit. :neutral_face:

Sorry, I wasn’t trying to give off an angry vibe, just trying to emphasize the text to hopefully draw more attention from other users skimming past. :grimacing:

Have you made sure HTTPService is on? It is off by default.

(You’d be surprised how many people ask for help when they forgot to turn on HTTPService…)

Also I recommend using UserId as opposed to the username.

Lol, I’ve made that mistake before.

No, I’ve made sure that it’s on. If it wasn’t on it’d throw an error telling me to turn it on. My discord webhook works fine as so it’s definitely online, Thanks though.

And if you read above you can see that I’ve already applied that and I’ve said the same thing to the last 3 people who mentioned that.

1 Like

You have to be careful with assumptions here. The print calls not printing does not tell you whether or not you got into the if block or not. If you put a wait() between the prints and the PostAsync, you might see them print. This is why it’s important to find out if that PostAsync is actually returning, or yielding for some long period of time (longer than you’re waiting) because it’s not getting a response from the web server you’re calling.

If you weren’t getting into the if block, removing the PostAsync would also not change anything…

That’s really strange actually, I would have never thought that a request sent after a print would also yield the prints. Could you explain the logic behind that? I’m really curious because I’ve never experienced such an event.