Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[Error fixing] Code for privacy glass not working?

Hello everyone! Im trying to make a privacy glass code that when clicked it will change the transparancy. But it doesn't seem to be working! What can i do?

game.Workspace.pgoeclickdetect.OnServerEvent:Connect(function()
	
	pe = false
	privacyone = game.Workspace.privacyglassone
	
	print("pe info stored")
	
	if privacyone.Transparency == 0.55 then
		pe = true
	
	
	elseif privacyone.Transparency == 0 then
		pe = false
	
	end
	
	if pe == false then
		privacyone.Transparency = 0.55
		print("Pe false")
	
	elseif pe == true then
		privacyone.Transparency = 0	
		print("Pe true")
	end
	
end)

2 comments

0

Is "pgoeclickdetect" a ClickDetector or RemoteEvent? OnServerEvent is an event used for RemoteEvents.

0

If it is a click detector then you do not need a remote event.

1 answer

✓ Accepted answer

In this case use ClickDetectors instead of RemoteEvent

This discussion is preserved as it was. New answers, comments, and votes are closed.