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

Can somebody help me with :FireAllClient() to make a GUI visible to everybody on click of a button?

Okay! So I am making a script so that if you click a screen GUI button, a GUI will pop up on all players screen.

Local script (For Button) ``script.Parent.MouseButton1Click:Connect(function() local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage")

local client = Players.LocalPlayer

ReplicatedStorage.ShowImage.OnClientEvent:Connect(function(visible)

	local StarterGui = game:GetService("StarterGui")
	local gui = StarterGui:WaitForChild("ScreenGui")

	local Gui2 = gui:WaitForChild("Data")
	local guiToDuplicate = Gui2:WaitForChild("Frame")
	local PlayerGui = game.Players:WaitForChild('PlayerGui')
	local duplicatedGui = guiToDuplicate:Clone()
	local  reset = game.Players.LocalPlayer.Name
	duplicatedGui.Parent = client.PlayerGui.ScreenGui.Data
	duplicatedGui.Visible = true
	duplicatedGui.Name = reset
	duplicatedGui.TextLabel.Text = reset.."'s" .. " Server"
	
	
end)
end)

I have a Remote Event called ShowImage in Replicated Storage.

Server Script (In ServerScriptService)

`` local ReplicatedStorage = game:GetService("ReplicatedStorage")

ReplicatedStorage.ShowImage.OnServerEvent:Connect(function(player) ReplicatedStorage.ShowImage:FireAllClients(true) end)

When I try to run it, nothing happens. If somebody can tell me where I am making a mistake I would be thankful!

1 answer

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