Scripting Help | Local Part Click Detector

Hi, So im trying to make it so when a player clicks a part, it changes the part anchored to false, but it isnt working. Here is my script (local script, inside plr camera) (Also, i want it so it only effects the player that clicked it, and so nobody else see’s any diffrence)

game.Workspace.LightSecret.ClickDetector.MouseClick:Connect(function(hit)
	game.Workspace.LightSecret.Anchored = false
end)

Sorry for reposting, but the old one doesnt work, and ive tried everything.

LocalScripts only run when they are parented to a player’s PlayerScripts, PlayerGui, Backpack, their character, and ReplicatedFirst. The camera is in workspace, and LocalScripts don’t run in workspace. Move the LocalScript to StarterPlayerScripts or something and see if it works.

Sure. Lettme see if that works

Nope.

Also, I Tried Using A Diffrent Script From Somebody

local Players = game:GetService("Players")
local client = Players.LocalPlayer

local Workspace = game:GetService("Workspace")

Workspace.LightSecret.ClickDetector.MouseClick:Connect(function(player_who_clicked)
	if player_who_clicked ~= client then -- another player
		print("Incorrect Player")
		return
    end

	Workspace.LightSecret.Anchored = false
end)

TOPIC CLOSED. I fixed the problem.