How to make other players cars invisible but localy

How can I make other players cars invisible? At first I thought I’d use games.Players and GetChildren() but it would also affect the player who should not have the invisible car. I’d like to specify that the names of the models end in “sCar”.

Honestly that would look weird since the other players would be driving in invisible cars

You could just handle the changes on a LocalScript, so that the player will only be able to see their car but not other cars

How can I do that? And I only want to do that when they are in a garage but already that one I have, I just need to make them invisible.

Well, you could either use a Touched Event or Region3 to detect when the player enters the garage, preferably the second option so that it’s more efficient (Or you can activate a function):

local Player = game.Players.LocalPlayer
local Garages = workspace.Garages:GetChildren()

--You should only run this when the player enters the garage
for _, Garage in pairs(Garages) do
    if Garage.Owner.Value == Player then
        for _, Car in pairs(workspace:GetChildren()) do
            if Car.Name == "sCar" then
                for _, CarPart in pairs(Car:GetChildren()) do
                    if CarPart:IsA("BasePart") then
                        CarPart.Transparency = 1
                    end
                end
            end
        end
    end
end

(Yes I’m using a lot of nested loops but whatever)

1 Like