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

How could I do this using FilteringEnabled?

Asked by 9 years ago

I made a script that changes the text of something using a function, but when I use FilteringEnabled it doesn't work at all. I was wondering if anybody could teach me on how to transform the function to a FilteringEnabled friendly function. Thanks!

Text Script:

function playerNotification(changeText)
    for i, v in pairs (game.Players:GetChildren()) do
        local gameInterface = v.PlayerGui:FindFirstChild("GameInterface")
        if gameInterface then
            gameInterface.Frame.TextLabel.Text = changeText
        end
    end
end

Example:

function playerNotification(changeText)
    for i, v in pairs (game.Players:GetChildren()) do
        local gameInterface = v.PlayerGui:FindFirstChild("GameInterface")
        if gameInterface then
            gameInterface.Frame.TextLabel.Text = changeText
        end
    end
end

function roundEnded()
    playerNotification('The round has ended!')
end

roundEnded()
0
You need to use remote events and remote functions. ScriptFusion 210 — 9y

2 answers

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

As ScriptFusion said, you'll need RemoteEvents. I can't provide a link to a tutorial at the moment, since I'm in school, but if you go on the ROBLOX Wiki, search RemoteEvents and you'll get one. Once you learn them, here's how you should approach this:

Have a RemoteEvent placed in their backpack. Have a LocalScript in their backpack that manages that ClientEvent. Have a serverscript loop through all the players, go into their backpack, then fire the event. It's a bit too much to just give it all to you, however I hope this approach helps.

Ad
Log in to vote
0
Answered by
unmiss 337 Moderation Voter
9 years ago

Please check a detailed explanation I gave to a similar question here.

Answer this question