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

How could I do this using FilteringEnabled?

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

1 comment

0

You need to use remote events and remote functions.

2 answers

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.

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