im trying to make a announcement thing and i want it to clone a gui from the server to all clients
so if i was to press a button it would clone a gui to every client
im trying to make a announcement thing and i want it to clone a gui from the server to all clients
so if i was to press a button it would clone a gui to every client
You can use a for loop! Let me know if you dont understand
for _,v in pairs(game.Players:GetPlayers()) do
local clone = gui:Clone()
gui.Parent = v.PlayerGui -- v is the player which is got through the loop
end
--server
local announcementThing = Instance.new("RemoteEvent", game.ReplicatedStorage);
announcementThing:FireAllClients()
--client
local function cloneAll()
local requestedGui = ________________:Clone();
requestedGui.Parent = game.Players.LocalPlayer.PlayerGui;
end
announcementThing.OnServerEvent:Connect(cloneAll)
Wrong. The server is not restricted from dropping clones into the PlayerGui. Not only that, but it can also access what it put in there. Cloning anything on the client is client-side only and does not save to the server.
My answer would work if you weren't intending on monitoring the gui, but I was assuming this was just a simple announcement for all the clients, then my answer would definitely work. Ergo, my answer is correct in some sense. Please assess what I was actually saying before you give a wee comment.
Basing off what you had said, it does make sense, and I know what you were meaning to say. But, using RemoteEvents would reduce player lag, in the correct answer of this thread it wouldn't be such a great idea to have a loop for all players from a serverScript if you were intending to make a full fledged game.
Server Lag*
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Wouldn't work with proper FE.
ima test it
Wrong ^. It does work with FE.