Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Error while trying to use LocalTransparencyModifier, what's the reason?

Hello, Devs!

I was making FPS game in Roblox from YouTube tutorial and everything worked correctly until this moment. I written script perfectly as he and in the same location. Errors are on the bottom of the question.

CODE:

local player = game.Players.LocalPlayer

local model = game.Workspace:WaitForChild(player.Name)

local rightLower = model:FindFirstChild("RightLowerArm")
local rightUpper = model:FindFirstChild("RightUpperArm")
local rightHand = model:FindFirstChild("RightHand")

game:GetService("RunService").RenderStepped:Connect(function()
	
	rightLower.LocalTransparencyModifier = 0
	rightUpper.LocalTransparencyModifier = 0
	rightHand.LocalTransparencyModifier = 0
	
end)

ERRORS:

Workspace.ErktikyYT.Arms:9: attempt to index nil with 'LocalTransparencyModifier' line 11,12,13

2 comments

0

Sorry the guy didn't even solve your question and your accepting it?

0

i did solve it? He did exactly what i told him to do and it worked. stop trying to get people to unaccept answers.

1 answer

try moving everything besides the player variable into the renderstepped function.

6 comments

0

Still same error.

0

Try changing all of the times you use FindFirstChild to WaitForChild

0

Game was in R6 and script was written for R15 but after changing into R15 error looked like this:

0

Workspace.ErktikyYT.Arms:13: attempt to index nil with 'LocalTransparencyModifier'

0

Nvm, I just put variables again into function and it worked. I am accepting your answer.

0

why did u unaccept it

This discussion is preserved as it was. New answers, comments, and votes are closed.