Hi! I am attempting to make a police CAD system. I ran into a slight problem making this. I am trying to make a button where when the Dispatcher clicks it, it takes the TextBox text and sends it to a Server Event which would then fire all clients. ( I don’t know if a client can fire all clients? ) In doing so, I tried to then get the clients to clone a holder and then change the text. I didn’t position it because I assumed the UIListLayout would position it itself. My code is as follows…
–The below is a LocalScript.
--Dispatch
DispatchScreen.NewCall.NewCall.NewCall.MouseButton1Click:Connect(function()
local ctype = DispatchScreen.NewCall.NewCall.type.Text
local cdesc = DispatchScreen.NewCall.NewCall.desc.Text
game.ReplicatedStorage.CaDSystem.Events.NewCallEvent:FireServer(ctype, cdesc)
end)
-- Client
game.ReplicatedStorage.CaDSystem.Events.NewCallEvent.OnClientEvent:Connect(function(ctype, cdesc)
local newcallframe = PoliceScreen.CallInfo.CallInfo.ScrollingFrame.Call:Clone()
newcallframe.type.Text = ctype
newcallframe.desc.Text = cdesc
local newcallframe2 = DispatchScreen.CallInfo.CallInfo.ScrollingFrame.Call:Clone()
newcallframe2.type.Text = ctype
newcallframe2.desc.Text = cdesc
end)
Below is the ServerScript which would fire all clients…
game.ReplicatedStorage.CaDSystem.Events.NewCallEvent.OnServerEvent:Connect(function(plr, ctype, cdesc)
game.ReplicatedStorage.CaDSystem.Events.NewCallEvent:FireAllClients(ctype, cdesc)
end)