Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Changing Transparency On R15 Character?

Asked by 6 years ago
Edited 6 years ago

I'm trying to use R15 but the script just won't change it even though no errors? What am i doing wrong?

game:GetService("Players").PlayerAdded:Connect(function (player)
    player.CharacterAdded:Connect(function (character)
        local ghost = character:WaitForChild("RightHand")
        if (ghost) then
            ghost.Transparency = 1
        end
    end)
end)
0
RIghtHand must not be a child. Are you playing in Studio and is the game published? Meltdown81 309 — 6y
0
I tried publishing it yes and not sure how to re-write it without waitfor. The script is in server script server Iiontamer 2 — 6y
0
are you trying to make 1 part transparent or multiple parts? 4PlayerGamingRoblox 38 — 6y
0
Just trying to make my RightHand Transparent , R15 Meshparts rig Iiontamer 2 — 6y
View all comments (2 more)
0
You have to wait for the RightHand to finish loading, you could use repeat...until or wait a few seconds then do the commands Konethorix 197 — 6y
0
no need of the 'if' statement, since you are using WaitForChild() it is guaranteed that RightHand exists Le_Teapots 913 — 6y

2 answers

Log in to vote
-1
Answered by 6 years ago
Edited 6 years ago

You need to use :FindFirstChild() when you are wanting a Bool Value result and you don't need any brackets when you are asking for a Bool Value and also, you need to add a wait after Characteradded to give the script time after the child is added

Here's a fixed Version for you

game:GetService("Players").PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        wait()
        local ghost = character:FindFirstChild("RightHand")

        if ghost then
            ghost.Transparency = 1
        end
    end)
end)
0
why do u need findfirstchild when using bool dareveloper 9 — 6y
0
This worked for me so not going to question it. I'm gonna try to study the different values on this. Thank you Iiontamer 2 — 6y
Ad
Log in to vote
0
Answered by
hellmatic 1523 Moderation Voter
6 years ago
Edited 6 years ago

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) -- basically the same thing as characteradded
------------------------------------------------------------------------------------------------------------

local Player = game.Players:WaitForChild(game.Players.LocalPlayer.Name)
local Character = Player.Character

local HideAccessorys = true -- set this to true or false if you want the player's hats to be hidden or not

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.

Answer this question