owner = script.Parent.OwnerName
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.Button1Down:connect(function(hit)
local check = hit.Parent:FindFirstChild("Humanoid")
local thisplr = game.Players:findFirstChild(hit.Parent.Name)
if owner.Value == thisplr then
script.Parent.Locked = false
else
script.Parent.Locked = true
end
end)
So this is a LocalScript, this localscript is inside a part called "brick". The brick has stringvalue of OwnerName and value of Player1, i just directly Assigned it for testing. So, When you click it and your name is not Player1 the brick will remain locked, but if your name is Player1 then locked is false. But it's not working. Please help.
