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

Did Filtering Enable Break My Script?

Asked by 7 years ago
Edited 7 years ago

So, I recently enabled filtering and I dont know if it is related to the problem I am having but it seems to be that this script only works in studio and not in-game. Why is that?

button = script.Parent
window = button.Parent

function onClicked(GUI)
    window:remove()
end
script.Parent.MouseButton1Click:connect(onClicked)
0
Is your game filtering enabled? Radstar1 270 — 7y
0
Today I made it FE BunnyFilms1 297 — 7y

3 answers

Log in to vote
0
Answered by
Radstar1 270 Moderation Voter
7 years ago

The reason it works in Studio, and not the testing client is because you recently made your game filtering enabled. So you would have to make a RemoteEvent in order to get it to fire correctly. Here's a tutorial on how to use them: <http://wiki.roblox.com/index.php?title=Remote_Events_and_Functions >

Also here's a quick breakdown of what filtering enabled does to your game: http://wiki.roblox.com/index.php?title=FilteringEnabled

Here's what I would do: 1.Change your regular script in your GUI into a local script. 2.Make a RemoteEvent and put it in ReplicatedStorage 3.When using RemoteEvents, one script fires the event (In this case your local script) while another script listens for that firing and then runs whatever needs to be done. (The second script)

0
:( I thought I was a good beginner scripter but now I feel like this will be very difficult to learn :( BunnyFilms1 297 — 7y
0
Nooo not at all, RemoteEvents and RemoteFunctions are a little difficult to grasp. Take it step by step. Understand why you need them when you turn on filtering enabled. Radstar1 270 — 7y
Ad
Log in to vote
0
Answered by 7 years ago

:remove() Is not an event, use :Destroy() I also have an easier way to call in the function, here is the script

button = script.Parent
window = button.Parent

script.Parent.MouseButton1Click:connect(function()
window:Destroy()
end)

So that is alot shorter, enjoy!

0
Thank you! But why does this not work in-game yet it works in studio? BunnyFilms1 297 — 7y
0
Is it in a local script or normal script? douglel 1 — 7y
0
It is a normal script. BunnyFilms1 297 — 7y
0
Normal scripts don't work in StarterGui for FilteringEnabled. If you have regular scripts, you'd need to convert them to local. @BunnyFilms1 Precisionly 103 — 7y
Log in to vote
0
Answered by 7 years ago

Just make the script a local script. Scripts don't work in PlayerGui.

Answer this question