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()
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.