I have a lock script that I want it so that once someone locks something only they can unlock it. Everything they locked becomes unlocked 60 seconds after they leave
function onMove(mouse)
targ = mouse.Target
if targ==nil then return end
if targ.Locked==true then script.Parent.Parent.Parent.Message.Text = "Brick Is Locked"
else
script.Parent.Parent.Parent.Message.Text = "Brick Isn't Locked"
end
end
function onButton1Down(mouse)
targ = mouse.Target
if targ == nil then return end
if targ.Locked == true then
targ.Locked = false
else
targ.Locked = true
end
end
function onS(mouse)
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
Instance.new("Hint").Parent = script.Parent.Parent.Parent
mouse.Move:connect(function() onMove(mouse) end)
end
script.Parent.Selected:connect(onS)
function onUnS(mouse)
script.Parent.Parent.Parent.Message:Remove()
end
script.Parent.Deselected:connect(onUnS) |