Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Error fixing] Code for privacy glass not working?

Asked by 5 years ago

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)
0
Is "pgoeclickdetect" a ClickDetector or RemoteEvent? OnServerEvent is an event used for RemoteEvents. xPolarium 1388 — 5y
0
If it is a click detector then you do not need a remote event. User#21908 42 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

In this case use ClickDetectors instead of RemoteEvent

Ad

Answer this question