How to make every part in the map invisible

how to make every part in the map invisible and only you can see it other cant

i try

for i ,v in pairs(map:GetChildren()) do
but the map being invisible slowly

Do you want only a specific player with a specific userid be able to see the map?

i want the player who use this ability make the map invisible and only him can see it

use local script and put somewhere in playerscript also can you explain more what you want it does like how to trigger it in your mind?

What you’re doing is a bit resource extensive, depending on how many parts are in the map. But if you wish to proceed, use TweenService

local tweenService = game:GetService("TweenService")
local map = wherever

for _, v in pairs(map:GetDescendants()) do
    if not v:IsA("BasePart") then continue end

    tweenService:Create(
        v,
        TweenInfo.new(
            1, -- time in seconds for parts to completely fade out.
            Enum.EasingStyle.Sine, -- This EasingStyle and EasingDirection are the smoothest.
            Enum.EasingDirection.InOut
        ),
        {Transparency = 1} -- We tween the transparency.
    ):Play()
end

what this script and tweenservice do?

script is server side when you do something in script everyone got effect it
and tweenservice it feature roblox make part or gui have animation like rotate or position also transparency and color Size

Try this

-- Script
local invisEvent = Instance.new("InvisEvent")
invisEvent.Parent = game.ReplicatedStorage

invisEvent.OnServerEvent:Connect(function(player)
   for i, v in pairs(map:GetChildren() do
      if v:IsA("BasePart") then
         v.Transparency = 1
      end
   end

   invisEvent:FireClient(player)
end)
-- Local Script
repeat wait() until game.ReplicatedStorage:FindFirstChild("InvisEvent")

local invisEvent = game.ReplicatedStorage.InvisEvent

local function useAbility()
   invisEvent:FireServer()
end

invisEvent.OnClientEvent:Connect(function()
   for i, v in pairs(map:GetChildren() do
      if v:IsA("BasePart") then
         v.Transparency = 0
      end
   end
end)

When the player uses the ability, make sure to add the line

useAbility()

It’s exactly what you asked for. All the parts in your map slowly disappear. This is just a concept, of course. Apply it to your own code when you want to trigger it.

the script make the player who activated the ability see it and other cant?

tween service is like a loop but it calculates step by step the target property

when ability activated how to make all the part in the map fly away? and wait 10 second the part fly back

If you want that then use a LocalScript.

Does this work? I make it as a userinputservice and make event fire server and in serverscriptservice I add server onserverevent trigger your script btw how to make the part slowly coming back