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

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

Asked by 3 years ago

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"

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. NGC4637 602 — 3y
0
tfw minified script greatneil80 2647 — 3y
0
Try indenting your script correctly next time. It will be easier to read. RAFA1608 543 — 3y

2 answers

Log in to vote
1
Answered by
NGC4637 602 Moderation Voter
3 years ago
Edited 3 years ago

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)
Ad
Log in to vote
0
Answered by 3 years ago

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.

Answer this question