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

How do I make R15 first person arms?

Asked by 6 years ago

This is my Script:

game.Players.PlayerAdded:connect(function(Player)
    game.Workspace:WaitForChild(Player.Name)
    local Cam = Instance.new("Model",game.Workspace.CurrentCamera)
    Cam.Name = "View"
    for i,v in pairs(Player.Character:GetChildren())do
        if v.Name == "LeftHand" or v.Name == "LeftLowerArm" or v.Name == "LeftUpperArm" then
            local x = v:Clone()
            x.Parent = Cam
            x.Material = "SmoothPlastic"
        end 
    end
end)

The problem is that when the player spawns in the Left arm looks deformed. How would I fix that problem?

2 answers

Log in to vote
3
Answered by
hellmatic 1523 Moderation Voter
6 years ago
Edited 6 years ago

Paste this in a LocalScript and place it in StarterCharacterScripts or StarterPack.

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

local RightArmList = {'Right Arm', 'Right Hand', 'RightLowerArm', 'RightUpperArm'}
local LeftArmList = {'Left Arm', 'Left Hand', '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
This makes your arms visible when you are first personed or fully zoomed in. Make sure to include all the part names for the right and left arm in R15 character (probably missed a few) hellmatic 1523 — 6y
1
nice awesomeipod 607 — 6y
0
Thanks! MRbraveDragon 374 — 6y
Ad
Log in to vote
1
Answered by 6 years ago

LocalScript inside of StarterPlayerScripts. This one is much more efficient than the first answer as this one needs no tables and works for both R6 and R15, so yeah.

local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()

while wait() do -- i had to wrap it in a while loop as when you died it wouldn't go visible anymore
    while wait() do -- in 2 while loops 
        game:GetService("RunService").RenderStepped:Wait()
            local ch = char:GetChildren()
            for c = 1, #ch do
                if string.match(ch[c].Name,"Hand") or string.match(ch[c].Name, "Arm") then
                    ch[c].LocalTransparencyModifier = 0
            end
        end
    end
end

Answer this question