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)
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)
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
.