Why this random shirt giver not working it should work but it just sets the player shirt to nothing
01 | local Shirts = { "593659701" } |
02 | local Faces = { "14721869" } |
03 | local RandomShirt = Shirts [ math.random( 1 ,#Shirts) ] |
04 | local RandomFace = Faces [ math.random( 1 ,#Faces) ] |
05 |
06 | game.Players.PlayerAdded:Connect( function (p) |
07 | p.CharacterAdded:Connect( function (c) |
08 | local shirt = c:WaitForChild( "Shirt" ) |
09 | local face = c.Head:WaitForChild( "Face" ) |
10 | if shirt and face then |
11 | shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=" .. RandomShirt |
12 | face.Texture = "http://www.roblox.com/asset/?id=4369496449" |
13 | end |
14 | end ) |
15 | end ) |
That shirt template thing does not work like that, the whole id for the shirt has to be inside the quotation marks. Try making a table with different IDs(full asset URLs) like this:
01 | local Shirts = { "http://www.roblox.com/asset/?id=323171733" , "http://www.roblox.com/asset/?id=144076358" } |
02 | local Faces = { "14721869" } |
03 | local RandomShirt = Shirts [ math.random( 1 ,#Shirts) ] |
04 | local RandomFace = Faces [ math.random( 1 ,#Faces) ] |
05 |
06 | game.Players.PlayerAdded:Connect( function (p) |
07 | p.CharacterAdded:Connect( function (c) |
08 | local shirt = c:WaitForChild( "Shirt" ) |
09 | local face = c.Head:WaitForChild( "Face" ) |
10 | if shirt and face then |
11 | shirt.ShirtTemplate = RandomShirt |
12 | face.Texture = "http://www.roblox.com/asset/?id=4369496449" |
13 | end |
14 | end ) |
15 | end ) |
I'd also suggest doing the same thing if you are making random faces too. Tell me if this works, because I'm not that much of an expert but it's worth a try.
EDIT: You can also change the IDs I put in the table, they're just for testing :D