local player = script.Parent.Parent.Parent.Parent
function onMouseClicked()
player.Character["Left Arm"].Transparency = 1
player.Character["Left Leg"].Transparency = 1
player.Character["Right Arm"].Transparency = 1
player.Character["Right Leg"].Transparency = 1
player.Character.Head.Transparency = 1
player.Character.Torso.Transparency = 1
for i,v in pairs(player.Character:GetChildren()) do
if v.ClassName == "Hat" then
v.Handle.Transparency = 1
end
end
wait(10)
player.Character["Left Arm"].Transparency = 0
player.Character["Left Leg"].Transparency = 0
player.Character["Right Arm"].Transparency = 0
player.Character["Right Leg"].Transparency = 0
player.Character.Head.Transparency = 0
player.Character.Torso.Transparency = 0
for i,v in pairs(player.Character:GetChildren()) do
if v.ClassName == "Hat" then
v.Handle.Transparency = 0
end
end
end
script.Parent.MouseButton1Down:connect(onMouseClicked)
most of the stuff is not needed
when a player clicks there will always be a character and a humanoid
humanoid does not have a transparency property
you do not need 2 functions like how you did it
|