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

Why is this not working?

This script I have is not working like there is no error and nothing happens? Script:

face1 = "http://www.roblox.com/asset/?id=162384466"
face2 = "http://www.roblox.com/asset/?id=162387197"
face3 = "http://www.roblox.com/asset/?id=162387541"
faces = {face1,face2,face3}
h = script.Parent.Parent.Character.Head
hft = h.face.Texture
game.Players.PlayerAdded:connect(function()
while true do
wait(5)
rm = math.random(1, #faces)
if rm == face1 then
	htf = face1
end
if rm == face2 then
	htf = face2
end
if rm == face3 then
	htf = face3
end
end
end)

1 answer

I think that would work, but here's what I would do:

local faces = {
"http://www.roblox.com/asset/?id=162384466",
"http://www.roblox.com/asset/?id=162387197",
"http://www.roblox.com/asset/?id=162387541" }

game.Players.PlayerAdded:connect(function(plr)
	while true do
		wait(5)
		player.Character.Head.face.Texture = faces[math.random(1,#faces)
	end
end)

Just cleans it up a bit.

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