Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

This script that changes the face of a certain player doesn't work but has no errors?

local players = "88559361"

  for i = 1, #players do
   if players[i] == plr.UserId then
    gear:Clone().Parent = plr:WaitForChild("Backpack")
    gear2:Clone().Parent = plr:WaitForChild("Backpack")
        local Head = chr:WaitForChild("Head")
                 for i, head in pairs (Head:GetChildren()) do
            if head:IsA("Decal") then
                print("FaceFound")
                print(head.Texture)
                if plr.UserId == players then
                    Head.Face.Texture = 'rbxassetid://478890416'
                end
            end
        end
   end
  end
 end)
end)

it has no errors but it doesn't change the face?

1 comment

0

change the variable players to hold table values so local players = {88559361,} and see if anything changes.

1 answer

✓ Accepted answer

First off, I don't understand why you are checking the length of the string. Right now, you are comparing each digit of the stored id with the player's entire userid. I would change your players variable to a table.

Also, please format your code properly. It helps the person answering your question out a lot.

local players = {88559361}

for i,v in pairs(players) do
   	if v == plr.UserId then
    	gear:Clone().Parent = plr:WaitForChild("Backpack")
    	gear2:Clone().Parent = plr:WaitForChild("Backpack")
        local Head = chr:WaitForChild("Head")
        for x,y in pairs (Head:GetChildren()) do
       		if y:IsA("Decal") then
                print("FaceFound")
                print(y.Texture)
                if plr.UserId == players then
                    Head.Face.Texture = 'rbxassetid://478890416'
        		end
  	 		end
  		end
 	end
end

1 comment

0

I tested this and it did the correct thing but I had already fixed it but thanks!!

This discussion is preserved as it was. New answers, comments, and votes are closed.