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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 17 Feb 2016 01:28 AM |
| Yeah..... that was just if all else fails xD |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 10 Aug 2010 |
| Total Posts: 1233 |
|
|
| 17 Feb 2016 01:32 AM |
| oh btw world model is inside the character directory |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 10 Aug 2010 |
| Total Posts: 1233 |
|
|
| 17 Feb 2016 01:35 AM |
| Praise to you advance! you've solved my issue |
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:35 AM |
I completely forgot about ":clearCharacterAppearance()".
Bloody genius.
|
|
|
| Report Abuse |
|
|
|
| 17 Feb 2016 01:36 AM |
| You guys are way over complicating this. |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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 |
|
|