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

How should I change these scripts to be compatible with FilteringEnabled?

Asked by 7 years ago

Hi, I am building a secret project and am wondering how to change the two scripts down below to be compatible with FilteringEnabled. I am kind of new to this, so all the help I can get is appreciated.

Note: There are ClickDetectors for these scripts.

function onClicked(playerWhoClicked)
    script.Parent.Parent.Visible = true

end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
function onClicked(playerWhoClicked)
    script.Parent.Parent.a.Visible = false
    script.Parent.Parent.b.Visible = false
    script.Parent.Parent.c.Visible = false
    script.Parent.Parent.d.Visible = false
    script.Parent.Parent.e.Visible = false
    script.Parent.Parent.f.Visible = false
    script.Parent.Parent.g.Visible = false
    script.Parent.Parent.h.Visible = false
    script.Parent.Parent.i.Visible = false
    script.Parent.Parent.j.Visible = false

end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

1 answer

Log in to vote
0
Answered by 7 years ago

click detectors will not work as expected with FE enabled, that said with FE enabled any changes locally will replicated to the server.

Here is a link that shows how a click detector can be implemented with FE enabled, How_to_invoke_server_specific_functions_from_the_client

As I do not know what a - j is I cannot suggest what action to take but in short, if it in an action that all users will see then you will need to use a remote function or event depending upon if you need a callback. If the action is for one user only e.g. gui's, local effects ect then you should not need to use a remote function/event.

Hope this helps

Ad

Answer this question