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

My filtering enabled finder script will not work ??

Asked by 5 years ago

if game.FilteringEnabled = true then print(Game is Filtering Enabled)

I'm kinda a big noob when it comes to scripting, I can do a little in LUA but not the advanced stuff. I tried to make that a script but since I don't know much about LUA, I can't edit it myself, and I need you guys to help me.

Best Regards, Nick

2 answers

Log in to vote
1
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
5 years ago

You should use double == when you compare things in lua.

Also, FilteringEnabled isn't a property of game, it's a property of workspace, so it should look like so:

if workspace.FilteringEnabled == true then
    print("Game is FE")
end

It can also look like this:

if workspace.FilteringEnabled then
    print("Game is FE")
end

Or even like this, using inline tenary statements:

print("Game is",workspace.FilteringEnabled and "FE" or "nonFE")
Ad
Log in to vote
0
Answered by 5 years ago

The code should be as follows:

if game.FilteringEnabled then
    print ("Game is FilteringEnabled")
end
0
thank you so much! ImASoulStealer 0 — 5y
1
game.FilteringEnabled isn't a thing Amiaa16 3227 — 5y
1
FilteringEnabled is a property of Workspace. jackfrost178 242 — 5y
0
Seemed fishy, but the guy had typed it down, so I didn't bother trying to research it. CyroStorms 4 — 5y

Answer this question