GUI Script Not Working (Local + Server) FIXED!

Hello! I am working on a game like “I’m on Observation Duty” and my scripts aren’t working in the GUI.

The “Report” Button Script: (Local)

local type1 = script.Parent.Parent.Parent:WaitForChild("Type")
local room = script.Parent.Parent.Parent:WaitForChild("Room")
local cObj = script.Parent.Types.Values:WaitForChild("CurObject")
local disappear = script.Parent.Types.Values:WaitForChild("Disappearance")

script.Parent.MouseButton1Click:connect(function()
	if type1.Value ~= "" and room.Value ~= "" then
		print(1)
		local room2 = workspace.Rooms:WaitForChild(room.Value)
		for i, v in pairs(room2.Furniture:GetChildren()) do
			if v.Anomaly.Value == true then
				if v.Types.Value == type1.Value then
					print("Local to Server")
					cObj.Value = v
					disappear.Value = true
				end
			elseif v.Anomaly.Value == false then
				print("No Anomalies Detected.")
			end
		end
	end
end)

I also made a different script thinking that would work: (Server)


	local v = script.Parent.Values:WaitForChild("CurObject").Value

script.Parent.Values.Disappearance.Changed:Connect(function(newValue)
	if newValue == true then
								print("Resolved!")
					v.Types.Value = "None"
					v.Anomaly.Value = false
					v.Transparency = 1
	end
end)

Everything else is working fine but these scripts won’t budge, no errors in output, here’s the layout:
code-1

Any help would be appreciated!
Please request any more pictures if needed.

1 Like

Yeah it’s not usually a good idea to put a script in a GUI Object.

Anyway, what exactly are you trying to make? I have never heard of the game.

A spot the difference -type of puzzle horror game about monitoring live surveillance camera footage and spotting anomalies. Anomalies range from furniture movement to intruders. Fix anomalies by filing a reports. You will need sharp eyes and good memory. The goal is to survive the entire night.

That’s the description

1 Like

What exactly is your script trying to do?

Making an object in the workspace disappear then the player has to file a report then it reappears.

I’ve changed the server script to local script but there were no results in any.

Changing a value on the client will not replicate to the server. You must use a RemoteEvent instead.