Instead of using PlayerAdded, you can use a local script and place it in StarterCharacterScripts.
Inside a Local Script:
repeat wait() until game.Players.LocalPlayer
repeat wait() until game.Players.LocalPlayer.Character:IsDescendantOf(workspace)
local Player = game.Players:WaitForChild(game.Players.LocalPlayer.Name)
local Character = Player.Character
local HideAccessorys = true
function GHOST()
for _, v in pairs(Character:GetChildren()) do
if v:IsA('BasePart') then
v.Transparency = 1
elseif HideAccessorys and v:IsA('Accessory') then
v.Transparency = 1
end
end
end
function SHOW()
for _, v in pairs(Character:GetChildren()) do
if v:IsA('BasePart') then
v.Transparency = 0
elseif HideAccessorys and v:IsA('Accessory') then
v.Transparency = 0
end
end
end
Make sure this is a LocalScript and place it in StarterCharacterScripts.
6 comments
RIghtHand must not be a child. Are you playing in Studio and is the game published?
I tried publishing it yes and not sure how to re-write it without waitfor. The script is in server script server
are you trying to make 1 part transparent or multiple parts?
Just trying to make my RightHand Transparent , R15 Meshparts rig
You have to wait for the RightHand to finish loading, you could use repeat...until or wait a few seconds then do the commands
no need of the 'if' statement, since you are using WaitForChild() it is guaranteed that RightHand exists