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

How do I make a uniform in a game? I really need help!

Hello there! I don't know how to make a uniform in game, like when you click on it you'll get the uniform. Does anybody know how?

3 comments

0

For anybody seeing this question, do not moderate it. This kid's got a good point. I'll downvote any moderations.

0

Just change the templateId from the shirt and pants inside the character?

0

Gonna moderate as the answers are here and he/she is still not marking anything as answered

2 answers

First create a part which is going to give the uniform to players. Then create a ClickDetector and parent it to the part.

Then make a script (a normal script, not localscript) that is going to handle the clothing change, like this:

local clickDetector = script.Parent
local clothing = {
	["Shirt"] = 123, --replace with the shirt id
	["Pants"] = 123, --replace with the pants id
}

clickDetector.MouseClick:Connect(function(plr)
	local char = plr.Character
	for i,v in pairs(clothing) do
		local c = char:FindFirstChildOfClass(i) or Instance.new(i, char)
		c[i .. "Template"] = v
	end
end)

3 comments

0

Why are you even helping a person who does not even try to make a good question and cannot script

0

^ I mean, Kiriot is probably trying to be nice to her since she was getting some unhelpful answers, but more of us would help if she would at least make some effort to do this.

0

^ Could be, I always try to help if people put effort in their questions, but he/she isn't a scripter or took effort to make the question/did any research

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