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

How do I make this script include torso and legs? (first person script)

Asked by 4 years ago

Scripting noob here, So I found and edited this script, and it works, but it only makes the arms visible, is there a way to make the torso and legs visible by editing this script? If not, what script can?

local player = game.Players.LocalPlayer
local character = player.Character

local RightArmList = {'Right Arm', 'RightHand', 'RightLowerArm', 'RightUpperArm'}
local LeftArmList = {'Left Arm', 'LeftHand', 'LeftLowerArm', 'LeftUpperArm'}

game:GetService("RunService").RenderStepped:connect(function()
    for _, v in pairs(character:GetChildren()) do
        --RIGHT ARM--
        for RA = 1, #RightArmList do
            if v.Name == RightArmList[RA] then
                v.LocalTransparencyModifier = 0
            end
        end

        --LEFT ARM--
        for LA = 1, #LeftArmList do
            if v.Name == LeftArmList[LA] then
                v.LocalTransparencyModifier = 0
            end
        end
    end
end)

0
you could just make a torso and leg list like you did with the arms, srry im a R6 dev! x_iIoveyou 0 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

The only thing I can think of is adding more values to the script with torso etc and add all the parts in in then copy and change the part where it checks through the values. Personally I just check for all the parts in the character and modifies everything but the HumanoidRootPart but I don't know how you are thinking so yeah. Hope this helps

Ad
Log in to vote
0
Answered by 4 years ago

Got it working, for anyone interested: Local script in starter player>starter character scripts

local player = game.Players.LocalPlayer
local character = player.Character

local RightArmList = {'Right Arm', 'RightHand', 'RightLowerArm', 'RightUpperArm'}
local LeftArmList = {'Left Arm', 'LeftHand', 'LeftLowerArm', 'LeftUpperArm'}
local RightLegList = {'Right Leg', 'RightFoot', 'RightLowerLeg', 'RightUpperLeg'}
local LeftLegList = {'Left Leg', 'LeftFoot', 'LeftLowerLeg', 'LeftUpperLeg'}
local TorsoList = {'Torso','LowerTorso', 'UpperTorso'}

game:GetService("RunService").RenderStepped:connect(function()
    for _, v in pairs(character:GetChildren()) do
        --RIGHT ARM--
        for RA = 1, #RightArmList do
            if v.Name == RightArmList[RA] then
                v.LocalTransparencyModifier = 0
            end
        end

       --LEFT ARM--
        for RA = 1, #LeftArmList do
            if v.Name == LeftArmList[RA] then
                v.LocalTransparencyModifier = 0
            end
        end
        --RIGHT LEG--
        for RA = 1, #RightLegList do
            if v.Name == RightLegList[RA] then
                v.LocalTransparencyModifier = 0
            end
        end
        --LEFT LEG--
        for RA = 1, #LeftLegList do
            if v.Name == LeftLegList[RA] then
                v.LocalTransparencyModifier = 0
            end
        end
        --TORSO--
        for LA = 1, #TorsoList do
            if v.Name == TorsoList[LA] then
                v.LocalTransparencyModifier = 0
            end
        end
    end
end)

0
It's much better just to put all parts you want to modify in one table, so you're not constantly having to reference them through 5 for loops. Robowon1 323 — 4y

Answer this question