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

[Edit] How would I fix this script that is supposed to change my face into a decal?

I'm attempting to make a script where when I say a particular word in chat, a script executes I've got that part down, but the script I'm using to change my face into a decal isn't working. (Attempted Face Change Script starts at Line 4 and ends at Line 8. The script is in a LocalScript, located in StarterPlayer, StarterPlayerScripts.

Error: Face is not a valid member of Part.

god = game.Players.DontBlinkDrWho -- who's chat the commands respond to
function onChatted(msg)
    if msg == "=)" then
    local players = game.Players:GetPlayers()
    local face1 = "rbxassetid://456163909"
    local face = game.Players.DontBlinkDrWho.Character.Head.Face.Decal
    game.Players.DontBlinkDrWho.Character.Head.Face.Decal = face1


end --this ties up the command
end --put this extra end after the last end of every command.

god.Chatted:connect(onChatted) --connects the function

2 comments

0

Have you tried changing "http://www.roblox.com/asset/?id=456163909" to "rbxassetid://456163909"?

0

I changed it. In developer console I get this error. "Head is not a valid member of Player."

1 answer

✓ Accepted answer
god = game.Players.DontBlinkDrWho -- who's chat the commands respond to
function onChatted(msg)
    if msg == "=)" then
    local players = game.Players:GetPlayers()
    local face1 = "rbxassetid://456163909"
    local face = game.Players.DontBlinkDrWho.Character.Head.face
    game.Players.DontBlinkDrWho.Character.Head.face.Texture = face1
	end --this ties up the command
end --put this extra end after the last end of every command.

god.Chatted:connect(onChatted) --connects the function

This should work. All I did was change the parts where you attempted to do Head.Face, the decal is actually face, with a lowercase f. Also, You tried doing face.Decal, this is not a thing. You meant to do face.Texture.

If this helped, accept this answer! Any question/problems, just comment bellow!

2 comments

0

The script works, but the head color is grey (Assuming a new part was made) I was wondering if you could fix it, here is the script I attempted: local headcolor = BrickColor.number == 125 game.Players.DontBlinkDrWho.Character.Head = headcolor

0

headcolor = BrickColor.new(125) try this

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