Hello! This is my second post today, because of a minor problem with my project.
The script says no anomalies detected when there are and it disrupts the game a small amount, script:
local type1 = script.Parent.Parent.Parent:WaitForChild("Type")
local room = script.Parent.Parent.Parent:WaitForChild("Room")
local reported = nil
script.Parent.MouseButton1Click:connect(function()
reported = false
script.Disabled = true
script.Parent.Text = "Sent!"
if type1.Value ~= "" and room.Value ~= "" then
local room2 = workspace.Rooms:WaitForChild(room.Value)
for i, v in pairs(room2.Furniture:GetChildren()) do
if v.Anomaly.Value == true then
reported = true
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
elseif v.Anomaly.Value == false then
if script.Parent.Parent.Parent.Static.Transparency == 0 then
if reported == false 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
end
script.Parent.Text = "Report"
script.Disabled = false
reported = false
end)
It repeats at least three times and I do not know how to fix it.
It shows no anomalies but in the game there are anomalies, then fixes it even though it said no anomalies.
Any help is appreciated!
Anomalies = Disturbance (It’s like a puzzle game you have to find out the disturbances and fix them before you lose.)