How do i make LocalScript Make 1 Player can't see Part but Order Player still see it

Script it work but LocalScript it not work like i drop my dummy and i can see Red Is Disappear too idk why [i even put on StarterCharacterScripts then StarterPlayerScripts and test but both not work] , idk it bug or i script something wrong
image


FlingOff = make Red Disappear
FlingOn & FlingOn [Extra] = make Red Appear

Script:

local FlingPart = workspace:WaitForChild("FlingPart")
function onTouched(hit)
    wait()-- amount of time until tele can be used again
    local human = hit.Parent:FindFirstChild("Humanoid")

    if hit.Parent ~= game.Players.LocalPlayer.Character then
        return -- not ourselves
    end

    if (human ~= nil) then 
        Location = script.Parent.Parent.TeleportIside.Position
        human.Parent:MoveTo(Location)
    end
end

script.Parent.Touched:connect(onTouched)
FlingPart.Touched:Connect(function(otherPart)
    local character = otherPart.Parent
    if character:IsA("Model") and character:FindFirstChild("Humanoid") then
        local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
        if humanoidRootPart then
            local oldPosition = humanoidRootPart.Position
            FlingPart.Position = Vector3.new(-94.794, -4.237, 407.822)
            print(oldPosition)
        end
    end    
end)

Hope Ya’ll Help me
Thank you Ya’ll

@Catasangel_2007, just want to make sure i understand: 1 player can see a part and the other can’t?

Yea that what i looking for but failed alot time

Are you getting any errors in the “Output”?

Well not, no error but failed.

Yeah i noticed that already

Anyways, try this:

  1. Create a remoteEvent in replicated storage and name it “PartVisibility” (don’t worry i won’t use transparency)

  2. Make a script in ServerScriptService and past this script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PartVisibility = ReplicatedStorage:WaitForChild("PartVisibility")
local FlingPart = workspace:WaitForChild("FlingPart")

local function onToggleVisibility(player)
    if FlingPart:IsDescendantOf(workspace) then
        FlingPart.Position = Vector3.new(-94.794, -4.237, 407.822)
        print(player.Name .. " can see the part.")
    else
        print(player.Name .. " cannot see the part.")
    end
end

PartVisibility.OnServerEvent:Connect(onToggleVisibility)
  1. Create a LocalScript in StarterPlayerScripts and put this script:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PartVisibility = ReplicatedStorage:WaitForChild("PartVisibility")

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local function checkPartVisibility()
    PartVisibility:FireServer()
end

character.HumanoidRootPart.Touched:Connect(function(hit)
    if hit.Name == "FlingPart" then
        checkPartVisibility()
    end
end)

i think that this should work now.

you… should read The script i make move not transparency…

Why the hell look like Ai make this…