generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: How can I make a player invisible?

Previous Thread :: Next Thread 
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
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 is not online. 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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
16 May 2014 08:04 PM
Ok, thanks so much!
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
16 May 2014 08:13 PM
Wait, just wondering, how would I handle the hat?
Report Abuse
TheProgrammingMaster is not online. TheProgrammingMaster
Joined: 20 Aug 2011
Total Posts: 7602
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 is not online. 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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
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 is not online. 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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
16 May 2014 08:24 PM
Ok, thanks!
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
17 May 2014 11:25 PM
Anyone know how?
Report Abuse
cntkillme is not online. 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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
17 May 2014 11:28 PM
elseif value:IsA("Shirt/Pants") then value.Decal.Transparency = 1

fixed
Report Abuse
cntkillme is not online. 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 is not online. 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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
17 May 2014 11:53 PM
Ok, it works now, thanks everyone!
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
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 is not online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
18 May 2014 05:39 AM
HumanoidRootPart is transparent by default. Ignore it.
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
18 May 2014 05:53 AM
Help?
Report Abuse
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
18 May 2014 06:01 AM
Why won't this part of the script work?
Report Abuse
opplo is not online. 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
Paramedic4 is not online. Paramedic4
Joined: 23 Jan 2011
Total Posts: 5934
18 May 2014 06:44 AM
What a genius idea! It worked! Thank you
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image