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

FilteringEnabled problems... Please, give me a hand?

Asked by
4inis 15
7 years ago
Edited 7 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

So I'm learning to script with FilteringEnabled. I'm trying to make a TextButton which inserts a Folder and another Folder into the first folder that is in the local player when clicked. I'm sure I've made a mistake somewhere because it works only on "Play Solo" mode.

The local script:

script.Parent.MouseButton1Click:connect(function()
    script.Parent.LocalScript.RemoteEvent:FireServer()
end)

The script:

script.Parent.RemoteEvent.OnServerEvent:connect(function(Player)
    if Player:FindFirstChild("Folder")then
        Player.PlayerGui.ScreenGui:Destroy()
        local Lytis=Instance.new("Folder")
        Lytis.Name="Moteris"
        Lytis.Parent=Player.Folder
    else
        Player.PlayerGui.ScreenGui:Destroy()
        local Folder=Instance.new("Folder")
        Folder.Parent=Player
        local Lytis=Instance.new("Folder")
        Lytis.Name="Moteris"
        Lytis.Parent=Player.Folder
    end
end)

So it doesn't work on testing in a server nor in a published to Roblox place. The output and developer console says nothing...

P.S. LocalScript is in TextButton. And the Script and RemoteEvent is in LocalScript.

Please, help me out!

0
Please just paste your code here in your question, don't put links to pictures of Studio. BlueTaslem 18071 — 7y

1 answer

Log in to vote
0
Answered by
Valatos 166
7 years ago

Try using OnClientEvent, cause it doesn't need to get fired on server, since its in the player it only has to be fired in the client

0
Thanks! 4inis 15 — 7y
0
No problem Valatos 166 — 7y
Ad

Answer this question