I have 2 different copies of hats inside of game.ReplicatedStroage.Hats.M > Hat1 and Hat2 are inside it, I would like the script to put a hat on, but using a Value of script.Parent.Hat
So player touches the brick and then he gets the Shirt, Pants, Face, but also a Hat, the same way Shirt and Pants are put on...
I'm trying to achieve a Character Customization system which could be easily edited, that's why I need it all in StringValues. I'm planning to add buttons which would change the Shirt/Pants/Face/Hat of the humanoid, and then when a Player steps on it, they will get the same look.
- I would be extremely thankful if anyone of you has a model of this and could share it with me, or could guide me through an easier way of doing this.
I can provide the model: http://www.roblox.com/Model-item?id=237741478
I can't really explain it any better, please ask questions :)
debouce = false
local shirt = script.Parent.Shirt
local pants = script.Parent.Pants
local face = script.Parent.Face
local hat = script.Parent.Hat
function onTouched(hit)
if debouce == false then
local h= hit.Parent:findFirstChild("Humanoid")
if h~=nil then
debouce = true
wait(0.1)
script.Parent.BrickColor = BrickColor.new("Black")
local RP=hit.Parent:GetChildren()
for i=1,#RP do
if RP[i].className=="Pants" then
RP[i]:remove()
end
end
local RS=hit.Parent:GetChildren()
for i=1,#RS do
if RS[i].className=="Shirt" then
RS[i]:remove()
end
end
local RH=hit.Parent:GetChildren()
for i=1,#RH do
if RH[i].className=="Hat" then
RH[i]:remove()
end
end
local P = Instance.new("Pants")
P.Parent = hit.Parent
P.PantsTemplate = pants.Value
local S = Instance.new("Shirt")
S.Parent = hit.Parent
S.ShirtTemplate = shirt.Value
local F = hit.Parent.Head.face
F.Texture = face.Value
wait(2)
script.Parent.BrickColor = BrickColor.new("Bright blue")
debouce = false
end
end
end
script.Parent.Touched:connect(onTouched)

5 comments
If I am not mistaken, using the Hat Class made by ROBLOX then parenting this into the players Character model will make said hat attach to the player. If you need an actual script to touch a part and get it from a service, Comment or PM me on ROBLOX.
Well, I was trying to achieve a Character Customization system which wouldn't be a touch script, but my scripting level isn't that advanced.
I'll make a script and show you how to put it inside of the Character from Replicated Storage. My hierarchy probably will differ from yours.
Will you base it on GUIs?
Like you were talking about, from touching a physical Part.