No response from script after MouseButton1Click

Hello, my last post this day until I clock out, I am making a horror / puzzle game where you have to spot the difference basically, and file a report to fix it, the report button does not change text and nothing gets fixed, no errors, and no warnings, here’s the script:

local type1 = script.Parent.Parent.Parent:WaitForChild("Type")
local room = script.Parent.Parent.Parent:WaitForChild("Room")
local reported = false
local cooldown = false

script.Parent.MouseButton1Click:connect(function() 
	script.Parent.Text = "Sent!"
	if type1.Value ~= "" and room.Value ~= "" then
		local room2 = workspace.Rooms:WaitForChild(room.Value)
		local roomanom=room2:WaitForChild("Anomaly")
		for i, v in pairs(room2.Furniture:GetChildren()) do
			local anom=v:WaitForChild("Anomaly")
			if v:IsA("Basepart") or v:IsA("Model") then
			if anom.Value == true and reported == false then
				if roomanom.Value == true then
									reported = true
						print(reported)
						print(v.Types.Value)
						print(type1.Value)
				if v.Types.Value == type1.Value then
					if v.Types.Value == "Disappearance" then
						game.ReplicatedStorage.Resolve:FireServer("Disappearance", room2)
						wait(4)
						game.SoundService.Static:Play()
						script.Parent.Parent.Parent.Static.Visible = true
						wait(5.365)
						script.Parent.Parent.Parent.Static.Visible = false
						elseif v.Types.Value == "Movement" then
						game.ReplicatedStorage.Resolve:FireServer("Movement", room2)
						wait(4)
						game.SoundService.Static:Play()
						script.Parent.Parent.Parent.Static.Visible = true
						wait(5.365)
						script.Parent.Parent.Parent.Static.Visible = false
					elseif v.Types.Value == "ExtraObj" then
						game.ReplicatedStorage.Resolve:FireServer("ExtraObj", room2)
						wait(4)
						game.SoundService.Static:Play()
						script.Parent.Parent.Parent.Static.Visible = true
						wait(5.365)
						script.Parent.Parent.Parent.Static.Visible = false
					elseif v.Types.Value == "LightAnom" then
						game.ReplicatedStorage.Resolve:FireServer("LightAnom", room2)
						wait(4)
						game.SoundService.Static:Play()
						script.Parent.Parent.Parent.Static.Visible = true
						wait(5.365)
						script.Parent.Parent.Parent.Static.Visible = false
					elseif v.Types.Value == "OpenCloseDoor" then
						game.ReplicatedStorage.Resolve:FireServer("OpenCloseDoor", room2)
						wait(4)
						game.SoundService.Static:Play()
						script.Parent.Parent.Parent.Static.Visible = true
						wait(5.365)
						script.Parent.Parent.Parent.Static.Visible = false
					elseif v.Types.Value == "PictureAnom" then
						game.ReplicatedStorage.Resolve:FireServer("PictureAnom", room2)
						wait(4)
						game.SoundService.Static:Play()
						script.Parent.Parent.Parent.Static.Visible = true
						wait(5.365)
						script.Parent.Parent.Parent.Static.Visible = false
					end
				end
				end

			elseif anom.Value == false and reported == false then
				if roomanom.Value == false then
									reported = true
				if script.Parent.Parent.Parent.Static.Transparency == 0 then
															script.Parent.Text = "Report"
				print("No Anomalies Detected.")
				script.Parent.Parent.Detect.Visible = true
				task.wait(1)
				script.Parent.Parent.Detect.Visible = false
				end
				end



			end
		end
	script.Parent.Text = "Report"
		reported = false
	end
end
end)

Here’s a video for better reference:

(I clicked the button while the door was open and when the light flickered.)

1 Like

Should check value by
print(v.Types.Value) and print(type1.Value)
So you’ll know typo was there or not.

1 Like

I’ve checked it no typos in those values. It stops around the

part so the error’s in there somewhere.

if v:WaitForChild("Anomaly").Value == true and reported == false then

First is this part, reported is reused.

local anom=v:WaitForChild("Anomaly")
if (not reported) and anom and room1anom.Value then
if room2:WaitForChild("Anomaly").Value == true then

Next is this.

local roomanom=room2:WaitForChild("Anomaly")
if roomanom and roomanom.Value then

And this.

if v:IsA("Basepart") then

This should include Model too.

It only says “Sent!” which is better than the text not changing at all but now the static won’t show up which is supposed to fix the difference.

Have you checked dev console too?