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

Transparency is not a valid member of Model "Workspace.Subway"?

I have this model that is an r6 character and he is a monster and there is this brick and when I touch it disappears but it won't disappear

local Subway = game.Workspace.Subway function onTouched() Subway.Transparency = 1 Subway.CanCollide = false end script.Parent.Touched:Connect(onTouched)

but it says Transparency is not a valid member of Model "Workspace.Subway"

3 comments

0

one thing, don't put your entire code into one line. It would make the script messy and hard to read. You might wanna optimize your scripts in case it errors.

0

tfw minified script

0

Try indenting your script correctly next time. It will be easier to read.

2 answers

the error says it all.

Transparency is not a valid member of Model "Workspace.Subway"? member can be a child or a property.

so that means the model doesn't have "Transparency" as a property.

How you are supposed to make the subway completely invisible:

local Subway = game.Workspace:FindFirstChild("Subway")

script.Parent.Touched:Connect(function(hit)
	if game:GetService("Players"):GetPlayerFromCharacter(hit.Parent) then -- I'm assuming you want the player to touch it so I'm adding this
		for _,v in pairs(Subway:GetDescendants()) do
			if v:IsA("BasePart") then
				v.Transparency = 1
				v.CanCollide = false
			end
		end
	end
end)

The script thinks your changing the Model Transparency which model doesn't have lol. I think your trying to change transparency of a part inside the model.

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