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

Anybody know how to remove hair or make it transparent??

Asked by 7 years ago

So I'm making an ssj script for a game and can't figure out how to make the hair transparent or just remove it. Please help ;-;

This is what I have tried:

--This is a local script in the StarterPack
local jun = script.Parent.Parent 
if jun.Character:FindFirstChildofClass("Accessory") ~= nil then
local Hair = jun.Character:FindFirstChildofClass("Accessory")
Hair.Handle.Transparency = 1
end
0
It's nice to see a fellow DBZ fan. :) TheeDeathCaster 2368 — 7y
0
:3 animelover6446 41 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Hey there! The issue is that your 'jun' pointer was to 'Players.Player1', which does not include the player's model. A quick solution that keeps the same premise as the script you've given us to work with is as follows:

--This is a local script in the StarterPack

local playerIndex = script.Parent.Parent.Name;
local player = workspace:WaitForChild(playerIndex);

for _, accessory in pairs(player:GetChildren()) do
    if (accessory.ClassName == "Accessory") then
        accessory.Handle.Transparency = 1;
    end
end

Essentially, we find the local player's name and index it in the workspace using the :WaitForChild(string 'childName') method, and then looping through the player's model, setting the transparency of all accessory objects to 1.

Hope this helps!

Ad

Answer this question