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

How do I make this script compatible with Filtering Enabled?

So I have this script which is located inside of a TextButton. It is meant to update all the text on the noticeboards in-game, but it only works in FD, not FE. Any help?

local line1 = game.Workspace.NoticeBoards.UpdateBoard1.FrontDeskInfo.SurfaceGui.slide1.l1
local line2 = game.Workspace.NoticeBoards.UpdateBoard2.FrontDeskInfo.SurfaceGui.slide1.l1
local line3 = game.Workspace.NoticeBoards.UpdateBoard3.FrontDeskInfo.SurfaceGui.slide1.l1
local line4 = game.Workspace.NoticeBoards.UpdateBoard4.FrontDeskInfo.SurfaceGui.slide1.l1
local line5 = game.Workspace.NoticeBoards.UpdateBoard5.FrontDeskInfo.SurfaceGui.slide1.l1
local line6 = game.Workspace.NoticeBoards.UpdateBoard6.FrontDeskInfo.SurfaceGui.slide1.l1
local line7 = game.Workspace.NoticeBoards.UpdateBoard7.FrontDeskInfo.SurfaceGui.slide1.l1
local info = script.Parent.Parent.l1

script.Parent.MouseButton1Click:connect(function()
	line1.Text = info.Text
	line2.Text = info.Text
	line3.Text = info.Text
	line4.Text = info.Text
	line5.Text = info.Text
	line6.Text = info.Text
	line7.Text = info.Text
	script.Parent.Text = "Updated"
	wait (0.5)
	script.Parent.Text = "Update"
	script.Parent.Parent.Parent.Visible = false
	
end)

2 comments

0

Fire a remoteEvent after MouseButton1Click and make a serverScript do all this stuff

0

From what you have shown, which obviously isn't the entire script, is fully compatible in a LocalScript.

1 answer

✓ Accepted answer

Put a Remote event and name it what ever you want for this Im going to call it "TheEvent"

LocalScript

script.Parent.MouseButton1Click:connect(function()
    script.parent.TheEvent:FireServer()
end)

Script

local line1 = game.Workspace.NoticeBoards.UpdateBoard1.FrontDeskInfo.SurfaceGui.slide1.l1
local line2 = game.Workspace.NoticeBoards.UpdateBoard2.FrontDeskInfo.SurfaceGui.slide1.l1
local line3 = game.Workspace.NoticeBoards.UpdateBoard3.FrontDeskInfo.SurfaceGui.slide1.l1
local line4 = game.Workspace.NoticeBoards.UpdateBoard4.FrontDeskInfo.SurfaceGui.slide1.l1
local line5 = game.Workspace.NoticeBoards.UpdateBoard5.FrontDeskInfo.SurfaceGui.slide1.l1
local line6 = game.Workspace.NoticeBoards.UpdateBoard6.FrontDeskInfo.SurfaceGui.slide1.l1
local line7 = game.Workspace.NoticeBoards.UpdateBoard7.FrontDeskInfo.SurfaceGui.slide1.l1
local info = script.Parent.Parent.l1

script.parent.TheEvent.OnServerEvent:connect(function()
    line1.Text = info.Text
    line2.Text = info.Text
    line3.Text = info.Text
    line4.Text = info.Text
    line5.Text = info.Text
    line6.Text = info.Text
    line7.Text = info.Text
    script.Parent.Text = "Updated"
    wait (0.5)
    script.Parent.Text = "Update"
    script.Parent.Parent.Parent.Visible = false
end)

Sorry If I spelled something wrong I did this right on the browser since I can't open studio

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