I am currently developing a survival game. I scripted a idle animation, and my game will be first person, when I go first person while the animations plays in it’s loop, the arms of my avatar disappear, the arms are there, I have a script to show the arms.
local armParts = {“LeftHand”, “LeftLowerArm”, “LeftUpperArm”, “RightHand”, “RightLowerArm”, “RightUpperArm”}
for i, bodyPart in pairs(char:GetChildren()) do
if table.find(armParts, bodyPart.Name) and bodyPart:IsA("BasePart") then
bodyPart.LocalTransparencyModifier = bodyPart.Transparency
bodyPart:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
bodyPart.LocalTransparencyModifier = bodyPart.Transparency
end)
end
What do you mean on the server? And what value? Sorry I’m very very new to scripting so I learn from others, I don’t copy and paste or anything like that, I used a tut ( But I wrote everything myself ), and I use Lua Learning.
Where do I insert it, do I put it with the other scripts in StarterCharacterScripts? And how do I write it? Is it like LocalTransparencyModifier = 0 ? Or is there more than that to it?
local armParts = {“LeftHand”, “LeftLowerArm”, “LeftUpperArm”, “RightHand”, “RightLowerArm”, “RightUpperArm”}
for i, bodyPart in pairs(char:GetChildren()) do
if table.find(armParts, bodyPart.Name) and bodyPart:IsA("BasePart") then
bodyPart.LocalTransparencyModifier = bodyPart.Transparency
bodyPart:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
bodyPart.LocalTransparencyModifier = bodyPart.Transparency
end)
end
Yes that is what you make a local script, put it in starter player scripts and put this in the script
local char = script.Parent.Parent
local humanoid = char:WaitForChild(“Humanoid”)
local armParts = {“LeftHand”, “LeftLowerArm”, “LeftUpperArm”, “RightHand”, “RightLowerArm”, “RightUpperArm”}
for i, bodyPart in pairs(char:GetChildren()) do
if table.find(armParts, bodyPart.Name) and bodyPart:IsA("BasePart") then
bodyPart.LocalTransparencyModifier = bodyPart.Transparency
bodyPart:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
bodyPart.LocalTransparencyModifier = bodyPart.Transparency
end)
end
I have that script already in there. The one I pasted, and this is the problem. When my animation plays, my hands are gone by my arms are there. Like this.
local char = script.Parent.Parent
local humanoid = char:WaitForChild(“Humanoid”)
local armParts = {“LeftHand”, “LeftLowerArm”, “LeftUpperArm”, “RightHand”, “RightLowerArm”, “RightUpperArm”}
for i, bodyPart in pairs(char:GetChildren()) do
if table.find(armParts, bodyPart.Name) and bodyPart:IsA("BasePart") then
bodyPart.LocalTransparencyModifier = 0
bodyPart:GetPropertyChangedSignal("LocalTransparencyModifier"):Connect(function()
bodyPart.LocalTransparencyModifier = 0
end)
end