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

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

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!

1 comment

0

Please just paste your code here in your question, don't put links to pictures of Studio.

1 answer

✓ Accepted answer

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

2 comments

0

Thanks!

0

No problem

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