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