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

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

Asked by 3 years ago
Edited 3 years ago

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

Log in to vote
0
Answered by 3 years ago

Hmm I still cannot figure it out..

Ad

Answer this question