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

Did Filtering Enable Break My Script?

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)

2 comments

0

Is your game filtering enabled?

0

Today I made it FE

3 answers

✓ Accepted answer

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)

2 comments

0

:( I thought I was a good beginner scripter but now I feel like this will be very difficult to learn :(

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.

: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!

4 comments

0

Thank you! But why does this not work in-game yet it works in studio?

0

Is it in a local script or normal script?

0

It is a normal script.

0

Normal scripts don't work in StarterGui for FilteringEnabled. If you have regular scripts, you'd need to convert them to local. @BunnyFilms1

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

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