Script not setting part's properties to false

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want the script to set my part’s properties to false

  2. **What is the issue?**The script will not set my part’s properties to false

  3. **What solutions have you tried so far?**I looked through my code no luck

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local Sound = game.Workspace.MISIC.SensitivePart:WaitForChild("Sound")
local S_SSID = "rbxassetid://2978605361"
local Proximity_Prompt = game.Workspace.MISIC.SensitivePart.ProximityPrompt
local MISIC = game.Workspace.MISIC.Part
local Alarm_Sound = game.Workspace.MISIC.SensitivePart.Alarm
local Alarm_SSID = "rbxassetid://9113089380"
Proximity_Prompt.Enabled = true
Proximity_Prompt.Name = "Break Glass"
Proximity_Prompt.ActionText = "Press and Hold B to break in"
Proximity_Prompt.KeyboardKeyCode = Enum.KeyCode.B
Proximity_Prompt.MaxActivationDistance = 5
Proximity_Prompt.HoldDuration = 10
Proximity_Prompt.Triggered:Connect(function()
	print("Touched Sucess")
	for i, Parts in pairs(game.Workspace.MISIC:GetDescendants()) do
		
		if Parts:IsA("Part") then
			Sound:Play()
			Sound.Volume = 5
			Parts.Anchored = false
			Parts.CanCollide = false
	task.wait(20)
	Alarm_Sound:Play()
	Alarm_Sound.Looped = true
	task.wait(30)
	Alarm_Sound.Looped = false
	Alarm_Sound.Playing = false
			print("Ended")
			Parts:Destroy()
		end
	end
end)

So i got a problem where everything else in the script works fine except the part’s properties i have told the script to set to false any idea why this is happening?

Is this a local script or a regular script? Where is this script located as well.

This is a server script, and the Script is located in Server Script Service

Your For loop was yield 20 seconds and 30 seconds what you can do is
More on this : MultiThread

task.spawn(function()

end)