|
| 16 May 2014 08:00 PM |
How can I do this, is it like:
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg == "invisible" then player:GetChildren() do -- Help! end end) end) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 May 2014 08:02 PM |
game.Players.PlayerAdded:connect(function(player) player.Chatted:connect(function(msg) if msg == "invisible" then if player.Character then for key, value in next, player.Character:GetChildren() do if value:IsA("BasePart") then value.Transparency = 1 end end end end end) end)
You should handle hats and the face decal, but that could be done in 2 lines. |
|
|
| Report Abuse |
|
|
| |
|
|
| 16 May 2014 08:13 PM |
| Wait, just wondering, how would I handle the hat? |
|
|
| Report Abuse |
|
|
|
| 16 May 2014 08:14 PM |
if value:IsA("BasePart") then value.Transparency = 1 elseif value:IsA"Hat" then value.Handle.Transparency = 1 end |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 May 2014 08:14 PM |
| You could add this to the loop: elseif value:IsA("Hat") then value.Handle.Transparency = 1 |
|
|
| Report Abuse |
|
|
|
| 16 May 2014 08:17 PM |
Ohh ok and then I can also do for decal:
elseif value:IsA("Decal") then value.Decal.Transparency = 1 |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 May 2014 08:18 PM |
yes, but for that you would actually check in the head (and really it will always exist) So at the end of the loop you could just do
player.Character.Head.face.Transparency = 1; --was it face? I believe it was.0.. |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 May 2014 11:17 PM |
| I got another problem, the shirt and pants don't turn invisible, how can I make them transparent? |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 May 2014 11:26 PM |
The tshirt should be Torso.roblox (a decal) The shirt/pants is juts Character.Shirt and Character.Pants (IIRC) |
|
|
| Report Abuse |
|
|
|
| 17 May 2014 11:27 PM |
So I would just do something like this for shirts and pants:
elseif value:IsA("Shirt?pants") then value.Decal.Transparency = 1
|
|
|
| Report Abuse |
|
|
|
| 17 May 2014 11:28 PM |
elseif value:IsA("Shirt/Pants") then value.Decal.Transparency = 1
fixed |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 May 2014 11:29 PM |
I assume the Shirt and pants already become invisible when the Torso/Rleg/lleft/larm/rarm are invisible, but the tshirt you can just do:
if character.Torso:FindFirstChild("roblox") then character.Torso.roblox:Destroy() end |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 17 May 2014 11:29 PM |
function Hide(HideThis) for _, Object in pairs (HideThis:GetChildren()) do ypcall(function() Object.Transparency = 1 end) Hide(Object) end end
Hide(Game.Players.Player1.Character) |
|
|
| Report Abuse |
|
|
|
| 17 May 2014 11:53 PM |
| Ok, it works now, thanks everyone! |
|
|
| Report Abuse |
|
|
|
| 18 May 2014 05:37 AM |
| Well, I was working on the part to make the player visible again but when I did, there was just one problem and it was that there was this blue part in the torso that didn't stay transparent. I checked and it was called HumanoidRootPart, I tryed : elseif Player.Character:FindFirstChild("HumanoidRootPart") then Player.Character.HumanoidRootPart.Transparency = 1 but it didn't work. How can I handle this? |
|
|
| Report Abuse |
|
|
opplo
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
|
| 18 May 2014 05:39 AM |
| HumanoidRootPart is transparent by default. Ignore it. |
|
|
| Report Abuse |
|
|
|
| 18 May 2014 05:41 AM |
| I know, its just that at the beginning of the visible script, I made all baseparts in Player visible, that also left the part HumanoidRootPart visible too, and now I am having problems turning it back transparent |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 May 2014 05:57 AM |
This is part of the script that malfunctions:
elseif Player.Character:FindFirstChild("HumanoidRootPart") then Player.Character.HumanoidRootPart.Transparency = 1 |
|
|
| Report Abuse |
|
|
|
| 18 May 2014 06:01 AM |
| Why won't this part of the script work? |
|
|
| Report Abuse |
|
|
opplo
|
  |
| Joined: 09 Dec 2008 |
| Total Posts: 5320 |
|
|
| 18 May 2014 06:10 AM |
Don't use that just put this in the invisible part.
if value:IsA("BasePart") and value.Name ~= "HumanoidRootPart" then |
|
|
| Report Abuse |
|
|
|
| 18 May 2014 06:44 AM |
| What a genius idea! It worked! Thank you |
|
|
| Report Abuse |
|
|