I am trying to change a humanoid's face decal fast kinda in a loop. The problem is that every time I have a new decal on, it refreshes the whole character (turns grey and loads the shirt and pants again)
and btw surfacegui+imagelabel do NOT help replace the decal, because it ineeds to be a round face
here is my script so far it is the child of the face decal
count = 0 local pic0 = "http://www.roblox.com/asset/?id=153633352" local pic1 = "http://www.roblox.com/asset/?id=153632933" local pic2 = "http://www.roblox.com/asset/?id=153632938" local pic3 = "http://www.roblox.com/asset/?id=153632945" while true do count = count + 1 if count == 1 then script.Parent.Texture = pic0 elseif count == 2 then script.Parent.Texture = pic1 elseif count == 3 then script.Parent.Texture = pic2 elseif count == 4 then script.Parent.Texture = pic3 elseif count == 5 then script.Parent.Texture = pic2 elseif count == 6 then script.Parent.Texture = pic1 elseif count == 7 then script.Parent.Texture = pic0 count = 1 end wait(0.1) end
My immediate suggestion is to make the player's actual head invisible/smaller (new/modified mesh?) and weld onto the character a psuedo-head that is not part of the character to apply the faces to.
Also, your code could benefit in a few ways.
1) "http://www.roblox.com/asset/?id=" can be accomplished using "rbxassetid://" so each of your assets can be referenced with less code.
2) You're repeating "rbxassetid://" several times, even though it's the same for all of the assets. This ought to be applied when setting the decal, except --
3) You're repeating the same code over and over when a table + loop would be much more effective. When you find yourself numbering variables and it ends up more than 3 different ones, or have, like you do, chains of checking against increasing values, you should be using a loop.
local pic = {153633352,153632933,153632938,153632945}; local animation = {1,2,3,2,1}; while true do for count = 1,7 do script.Parent.Texture = "rbxassetid://" .. pic[ animation[i] ]; wait(0.1); end end