Player Not Getting Badge Or Teleporting

When a player kills my BossNpc I want them to get a badge for defeating them and immediately teleport to another location but it wont work and im getting no output errors

local BOSS = game.Workspace:FindFirstChild("Boss") 
local playerWhoKilledNPC

BOSS.Humanoid.Died:Connect(function()
	playerWhoKilledNPC = game.Players:GetPlayerFromCharacter(BOSS.Humanoid) 
end)

local function handlePlayerCharacterAdded(player)
	player.CharacterAdded:Connect(function(character)
		if player == playerWhoKilledNPC then
			local newSpawnLocation = Vector3.new(100, 0, 100)

			character.HumanoidRootPart.CFrame = CFrame.new(newSpawnLocation)

			local badgeId = 2146995625 
			game:GetService("BadgeService"):AwardBadge(player.UserId, badgeId)
		end
	end)
end

game.Players.PlayerAdded:Connect(handlePlayerCharacterAdded)



Badges and TeleportService don’t work in studio, try testing them Ingame.

Also, Studio doesn’t display the notification for some reason, so verify on your profile if you got it or not.

should for you to use script like this script


		character.HumanoidRootPart.CFrame = CFrame.new(plr.CFrame.X,plr.CFrame.Y+5,plr.CFrame.Z)
-- plr = newSpawnLocation

i think you already have the badge