I've attempted to create a auto uniform script. It doesn't seem to want to work for some reason. Would anyone be able to fix this for me please?
print("Uniform Script Loaded Sucessfully!!")
local baseurl = "http://www.roblox.com/asset/?id="
local clothingData = {{rank = 1, shirt = 137338539, pants = 154082705},
{rank = 2, shirt = 137338539, pants = 137338545},
{rank = 3, shirt = 137338539, pants = 137338545},
{rank = 4, shirt = 137338539, pants = 137338545},
{rank = 5, shirt = 137338539, pants = 137338545},
{rank = 6, shirt = 137338539, pants = 137338545},
{rank = 7, shirt = 144851570, pants = 144939229},
{rank = 8, shirt = 144851570, pants = 144939229},
{rank = 100, shirt = 144851553, pants = 144939305},
{rank = 150, shirt = 144851553, pants = 144939305},
{rank = 151, shirt = 144938162, pants = 144937798},
{rank = 170, shirt = 144938162, pants = 144937798},
{rank = 249, shirt = 144943553, pants = 156726468},
{rank = 250, shirt = 144943553, pants = 156726468},
{rank = 251, shirt = 144850883, pants = 156726468},
{rank = 252, shirt = 144850883, pants = 156726468},
{rank = 253, shirt = 144850883, pants = 156726468},
{rank = 254, shirt = 144850883, pants = 156726468}}
function newPlayer(p)
if p:IsInGroup(869857) then
p.CharacterAdded:connect(function(c)
if not char:FindFirstChild("Pants") then
Instance.new("Pants", c).Name = "Pants"
end
if not char:FindFirstChild("Shirt") then
Instance.new("Shirt", c).Name = "Shirt"
end
local rank = p:GetRankInGroup(869857)
for i=1, #clothingData do
if v.rank == rank then
c.Shirt.ShirtTemplate = baseurl .. v.shirt
c.Pants.PantsTemplate = baseurl .. v.pants
end
end
end)
end
end
game.Players.PlayerAdded:connect(newPlayer)
for _,v in pairs (game.Players:GetPlayers()) do
newPlayer(v)
end

5 comments
You called the variable 'char' on lines 25 and 28 when it is non-existent. You declared the variable 'c' in the CharacterAdded function, so that is the variable you should use.
I have changed the char in both lines to c, but to no prevail.
May you print an output please
Uniform Script Loaded Sucessfully!! Loaded gloo library. Type _G.gloo.Help() for help. zars15's CFrame loaded 21:58:51.937 - Successfully opened file - C:/Documents and Settings/New User/AppData/Local/Roblox/visit.rbxl logging probability 0.064180425428022 not logging 21:58:52.484 - Attempt to connect failed: Passed value is not a function 21:58:52.484 - Script 'Players.Player1.Backpack.Musket.Sho
I moved the script to another world and I don't get any errors. Just no uniform.