Placed object detector not working

Hi my script dont working in my script and what do deleted player placed object but it print only Okay Thats mean for me Target Selected But if im click again then do anything
Script here

local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()
local BuildingNow = false
local Target = nil
script.Parent.MouseButton1Down:Connect(function()
if BuildingNow == false then
	print("Okey")
	wait(3)
	Target = Mouse.Target
	BuildingNow = true
  end
end)
function DestroyObject()
	if BuildingNow == true then
		if Target.Parent == player.Name.."Blocks" then
			print("Deleted Object")
			Target:Destroy()
			BuildingNow = false
		end
	end
end
function UpdateTarget()
	if BuildingNow == true then
		print("Target Updated")
		Target = Mouse.Target
	end
end
script.Parent.MouseButton1Down:Connect(UpdateTarget)
Mouse.Button1Down:Connect(DestroyObject)

And any error doesnt write anything
Thank for reading

Im fixed now okey do not write here anything

Mind posting how you fixed it and marking that post as the solution so that others can see what you tried in case they have the same problem in the future?

2 Likes