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

How do I make this script compatible with Filtering Enabled?

Asked by 6 years ago

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)

0
Fire a remoteEvent after MouseButton1Click and make a serverScript do all this stuff theCJarmy7 1293 — 6y
0
From what you have shown, which obviously isn't the entire script, is fully compatible in a LocalScript. MachoPiggies 526 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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

Ad

Answer this question