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

Howcome my group uniform script doesn't work?

So, my problem is that when I place this script, and then I place all the ID necessary. When I start the game the uniforms don't show up, help me please.

wait(1)
group = 226843 
rankuniforms = true --false if you have one uniform for all members
shirtnoranks = "http://www.roblox.com/asset/?id=" -- shirt asset, only needed if rankuniforms is false
pantsnoranks = "http://www.roblox.com/asset/?id=" -- pants asset, only needed if rankuniforms is false

totalranks = 2

rank1 = 1 -- rank number in group admin -- Private
shirt1 = "http://www.roblox.com/asset/?id=120932240" -- rank 1 shirt asset
pants1 = "http://www.roblox.com/asset/?id=120932317" -- rank 1 pants asset

rank2 = 2 -- rank number in group admin -- Sergeant
shirt2 = "http://www.roblox.com/asset/?id=120932257" -- rank 2 shirt asset
pants2 = "http://www.roblox.com/asset/?id=120932317" -- rank 2 pants asset

plr = script.Parent.Parent
repeat wait(.25) until plr.Character ~= nil
wait(1)
char = plr.Character
if plr:IsInGroup(group) then
	if char:FindFirstChild("Pants") ~= nil then
	else
		pnts = Instance.new("Pants")
		pnts.Name = "Pants"
		pnts.Parent = char
	end
	if char:FindFirstChild("Shirt") ~= nil then
	else
		pnts = Instance.new("Shirt")
		pnts.Name = "Shirt"
		pnts.Parent = char
	end
	if rankuniforms == true then
		if plr:GetRankInGroup(group)== rank1 then
			char.Shirt.ShirtTemplate = shirt1
			char.Pants.PantsTemplate = Pants1
		elseif plr:GetRankInGroup(group)== rank2 then
			char.Shirt.ShirtTemplate = shirt2
			char.Pants.PantsTemplate = Pants2
		else
		char.Shirt.ShirtTemplate = shirtnoranks
		char.Pants.PantsTemplate = pantsnoranks
	end
end

2 comments

0

This probably won't fix it, but to make it more lag-free replace repeat wait(.25) until plr.Character ~= nil with plr:WaitForChild("Character")

0

Thanks!

2 answers

✓ Accepted answer

You've got some syntax errors: Pants1 should be pants1 and Pants2 should be pants2.

Now, please make sure that the rank numbers you are inputting in the script are the right numbers. Try and open your group properties and see if the little number aside from the rank name are exactly like in the script.

1 comment

0

Thanks!

Remember, the uniform is the TEMPLATE, not the clothes you buy from the store. And, to find the template subtract 1 from the last two numbers, if you have any number, such that has a 1 at the end, it can't be 0, so subtract two. Remember to review your work and use the output to check errors.

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