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 » Scripters
Home Search
 

Re: Making body parts invisible

Previous Thread :: Next Thread 
CDDogg is not online. CDDogg
Joined: 10 Aug 2010
Total Posts: 1233
17 Feb 2016 01:20 AM
I need help. I have a script that when a player enters the game it will insert a disabled localscript in that players character then make the script enabled.

In the localscript I have:

for i,v in (script.Parent:GetChildren()) do
if v.ClassName == "Part" then
v.Transparency = 1
end
end

this doesn't work and the f9 console says it called a table value blah blah blah.

Weirdest thing is even though the f9 console confirms the script enabled and tried to work, when i look in the character directory there is no localscript.
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
17 Feb 2016 01:23 AM
Script in ServerScriptService:

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
for i, v in pairs (character:GetChildren()) do
--Fade Affect
if v.ClassName == "Part" then
local co = coroutine.create(function()
for i = 1, 10 do
v.Transparency = v.Transparency + .1
wait(.1)
end
end)
coroutine.resume(co)
end
end
end)
end)



Report Abuse
nofascistsaloudxD is not online. nofascistsaloudxD
Joined: 02 Sep 2015
Total Posts: 408
17 Feb 2016 01:25 AM
Why don't u just do it the long way like.....


player = game.Players.LocalPlayer
player.Character["Left Arm"].Transparency = 1
player.Character["Right Arm"].Transparency = 1
player.Character["Left Leg"].Transparency = 1
player.Character["Right Leg"].Transparency = 1
player.Character.Head.Transparency = 1
player.Character.Torso.Transparency = 1
Report Abuse
CDDogg is not online. CDDogg
Joined: 10 Aug 2010
Total Posts: 1233
17 Feb 2016 01:27 AM
That functions to an extent. Is there anyway to make hats invisible as well? or better yet just remove them all together
Report Abuse
CDDogg is not online. CDDogg
Joined: 10 Aug 2010
Total Posts: 1233
17 Feb 2016 01:28 AM
@nofacists

Because there are plenty more parts than body parts that need to be invisible.
Report Abuse
nofascistsaloudxD is not online. nofascistsaloudxD
Joined: 02 Sep 2015
Total Posts: 408
17 Feb 2016 01:28 AM
Yeah..... that was just if all else fails xD
Report Abuse
nofascistsaloudxD is not online. nofascistsaloudxD
Joined: 02 Sep 2015
Total Posts: 408
17 Feb 2016 01:31 AM
OOOH i know, you can figure out ALL of the names of roblox's hats and add a script that checks for each hat and if they have it, remove it.(Joking)xD
Report Abuse
CDDogg is not online. CDDogg
Joined: 10 Aug 2010
Total Posts: 1233
17 Feb 2016 01:32 AM
This works beautifully:

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
for i, v in pairs (character:GetChildren()) do
if v.ClassName == "Part" then
local co = coroutine.create(function()
for i = 1, 10 do
v.Transparency = v.Transparency + .1
wait(.1)
end
end)
coroutine.resume(co)
end
end
end)
end)

but can you include a parameter that removes hats and makes any parts inside a model called "worldmodel" invisible as well?
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
17 Feb 2016 01:32 AM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
for i, v in pairs (character:GetChildren()) do
--Fade Affect
if v.ClassName == "Part" then
local co = coroutine.create(function()
for i = 1, 10 do
v.Transparency = v.Transparency + .1
wait(.1)
end
end)
coroutine.resume(co)
end
end
--Remove Face
local head = character:FindFirstChild("Head")
if head then
local face = head:FindFirstChild("face")
if face then
face:Destroy()
end
end
character.ChildAdded:connect(function(child)
if child.ClassName == "Hat" then
child:Destroy()
end
end)
end)
end)




Report Abuse
CDDogg is not online. CDDogg
Joined: 10 Aug 2010
Total Posts: 1233
17 Feb 2016 01:32 AM
oh btw world model is inside the character directory
Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
17 Feb 2016 01:34 AM
game.Players.playerAdded:connect(function(player)
player.characterAdded:connect(function(character)
for _, child in next, (character:getChildren()) do
if (child:isA("BasePart")) then
child.Transparency = 1
end
end
character.Head.face:destroy()
while (not player:hasAppearanceLoaded()) do
wait()
end
player:clearCharacterAppearance()
end)
end)
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
17 Feb 2016 01:34 AM
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
for i, v in pairs (character:GetChildren()) do
--Fade Affect
if v.ClassName == "Part" then
local co = coroutine.create(function()
for i = 1, 10 do
v.Transparency = v.Transparency + .1
wait(.1)
end
end)
coroutine.resume(co)
end
end
local model = character:FindFirstChild("worldmodel")
if model then
for i, v in pairs (model:GetChildren()) do
if v.ClassName == "Part" then
v.Transparency = 1 --Doesn't deserve a fade affect c;
end
end
end
--Remove Face
local head = character:FindFirstChild("Head")
if head then
local face = head:FindFirstChild("face")
if face then
face:Destroy()
end
end
character.ChildAdded:connect(function(child)
if child.ClassName == "Hat" then
child:Destroy()
end
end)
end)
end)



Report Abuse
CDDogg is not online. CDDogg
Joined: 10 Aug 2010
Total Posts: 1233
17 Feb 2016 01:35 AM
Praise to you advance! you've solved my issue
Report Abuse
AdvancedObjects is not online. AdvancedObjects
Joined: 11 Dec 2012
Total Posts: 3354
17 Feb 2016 01:35 AM
I completely forgot about ":clearCharacterAppearance()".

Bloody genius.



Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
17 Feb 2016 01:36 AM
You guys are way over complicating this.
Report Abuse
CDDogg is not online. CDDogg
Joined: 10 Aug 2010
Total Posts: 1233
17 Feb 2016 01:38 AM
Well, upon further inspection worldmodel parts are still visible, perhaps that can be fixed by a waitforchild? after all they dont spawn in with worldmodel
Report Abuse
CDDogg is not online. CDDogg
Joined: 10 Aug 2010
Total Posts: 1233
17 Feb 2016 01:45 AM
Never mind I fixed it with a little reorganization
Report Abuse
3DReality is not online. 3DReality
Joined: 08 Mar 2015
Total Posts: 150
17 Feb 2016 01:47 AM
Sorry if this isint what you wanted but this should turn the player invisible on join

game.Players.PlayerAdded:connect(function(plr)
if plr then
local character = plr.CharacterAdded:wait()
for i,v in pairs (character:GetChildren()) do
if v.ClassName == "Part" then
v.Transparency = 1
end
end
end
end)


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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