Some one pls fix this http 400 error

  1. What do you want to achieve?

I want to fix Error Http 400 bad request

  1. What is the issue?

I am trying to Players:GetHumanoidDescriptionFromUserId() but roblox studio says

  1. What solutions have you tried so far?
    I looked dev forum to fix this, but there are no solutions of this problem.

This is a catch part script.

local teams = game:GetService("Teams")
local suv = teams.Survivor

script.Parent.Touched:Connect(function(players)
	
	local character = players.Parent
	local humanoid = character:FindFirstChild("Humanoid")
	
	if humanoid then
		
		local player = game.Players:GetPlayerFromCharacter(character)
		
		if player.Team == game.Teams.Survivor then
			
			if #suv:GetPlayers() > 1 then
				
				--There is no problem here

			elseif #suv:GetPlayers() == 1 then

				script.Parent.CanTouch = false

				local ItUserId = game.Players:GetUserIdFromNameAsync(<Put Player name here>)
				local VictimUserId = game.Players:GetUserIdFromNameAsync(Put Player name here>)

				local KillerSkin = game.Players:GetHumanoidDescriptionFromUserId(ItUserId) --ERROR HERE
				local VictimSkin = game.Players:GetHumanoidDescriptionFromUserId(VictimUserId) --ERROR HERE

local Dummy = game.Workspace.dummy
local Dummy2 = game.Workspace.dummy2

				Dummy.Humanoid:ApplyDescription(KillerSkin)
				Dummy2.Humanoid:ApplyDescription(VictimSkin)



				wait(5)
				player.Team = game.Teams.Eliminated
				humanoid.Health = 0
			end

			


		end

	end
	
end)

some one pls fix my script ;-;

IT SOLVED
Solution, reset cookies data.

Try to wrap it inside a pcall function.

1 Like

Http 400 - Bad Request is a problem on your end. It basically means something went wrong when trying to communicate to Roblox servers from your game. I suggest trying again in a few minutes/an hour because it is related to your internet/url problems/cookies/etc.

1 Like

Good advice but pcalls won’t fix a http 400 bad request error. Pcall can’t prevent internet issues

local ItUserId = game.Players:GetUserIdFromNameAsync(<Put Player name here>)
local VictimUserId = game.Players:GetUserIdFromNameAsync(Put Player name here>)

Just wondering if you actually left it as “Put Player name here” because that will NOT work. You need to specify a username for that.

game.Players:GetUserIdFromNameAsync("TestAccount563344")

Sorry if this isn’t what you’re looking for.

(Also you should use :GetService() :slight_smile: )

Thank you for reply!
But i use username for game.Players:GetUserIdFromNameAsync()
Thanks for advice :slight_smile:

It works!!
I reset cookies data then it works !!

1 Like

Hello, is there a way to get around it, like detect if it happens?

Hi there, sorry for the late reply but I do not believe there is a workaround to an internet issue. As for detecting it, I believe you can use a pcall function to detect if an error occurs and then check whether the error returned is an internet error or not.

1 Like