Show a frame for all players at the same time

Hello am working on a game and i want to show a Frame for all users a the same time , i tried with this script.

Sscript here :


game.Players.PlayerAdded:Connect(function(Player)
	IntroEvent:FireClient(Player)
end)

so could someone help me ? I want to put smth like this script at a moment on my main script and that show a frame for all players.
Tnks

-Cordially

I think you’re looking for FireAllClients()

Yes but when i tried fire all client that not working

Local:

local IntroEvent = game.ReplicatedStorage.RemoteEvents:FindFirstChild("IntroEvent")
local player = game.Players.LocalPlayer

IntroEvent.OnClientEvent:Connect(function() -- Edited Comment Here
	player.PlayerGui.Gui.Frame.Visible = true
end)

Script:

game.Players.PlayerAdded:Connect(function(Player)
	IntroEvent:FireAllClients()
end)
1 Like

You have to listen in your local script using RemoteEvent.OnClientEvent

that not working actually my script look like that :

Main script :

repeat wait() until workspace.GetJumpscared.GetJumpscared1.Transparency == 1
	
	if workspace.GetJumpscared.GetJumpscared1.Transparency == 1  then
		
		ObjectiveEvent:FireAllClients("")
	
		game.Players.PlayerAdded:Connect(function(Player)
			IntroEvent2:FireAllClients()
		end)

Here is the local script in the StarterGui :

local TweenService = game:GetService("TweenService")

local Player = game.Players.LocalPlayer

local RemoteEvent = game.ReplicatedStorage.RemoteEvents.SecondeIntroEvent

local ScreenGui = Player.PlayerGui:WaitForChild("IntroGui")

local Frame = ScreenGui:WaitForChild("Frame")

local ImageLabel = Frame:WaitForChild("ImageLabel")

local GameLabel = Frame:WaitForChild("GameLabel")

local TextLabelMain = Frame:WaitForChild("TextLabelMain")

local TextLabelInfo = Frame:WaitForChild("TextLabelInfo")

Frame.BackgroundTransparency = 0

local FrameInvisible = {}

local GameImageVisible = {}

local GameImageInvisible = {}

local ImageVisible = {}

local ImageInvisible = {}

local TextLabelMainVisible = {}

local TextLabelMainInvisible = {}

local TextLabelInfoVisible = {}

local TextLabelInfoInvisible = {}

FrameInvisible.BackgroundTransparency = 1

GameImageVisible.ImageTransparency = 0

GameImageInvisible.ImageTransparency = 1

ImageVisible.ImageTransparency = 0

ImageInvisible.ImageTransparency = 1

TextLabelMainVisible.TextTransparency = 0

TextLabelMainInvisible.TextTransparency = 1

TextLabelInfoVisible.TextTransparency = 0

TextLabelInfoInvisible.TextTransparency = 1

local Info = TweenInfo.new(1)

local TweenFrameInvisible = TweenService:Create(Frame, Info, FrameInvisible)

local TweenGameLabelVisible = TweenService:Create(GameLabel, Info, GameImageVisible)

local TweenGameLabelInvisible = TweenService:Create(GameLabel, Info, GameImageInvisible)

local TweenImageVisible = TweenService:Create(ImageLabel, Info, ImageVisible)

local TweenImageInvisible = TweenService:Create(ImageLabel, Info, ImageInvisible)

local TweenTextVisible = TweenService:Create(TextLabelMain, Info, TextLabelMainVisible)

local TweenTextInvisible = TweenService:Create(TextLabelMain, Info, TextLabelMainInvisible)

local TweenTextInfoVisible = TweenService:Create(TextLabelInfo, Info, TextLabelInfoVisible)

local TweenTextInfoInvisible = TweenService:Create(TextLabelInfo, Info, TextLabelInfoInvisible)

local players = game.Players

RemoteEvent.OnClientEvent:Connect(function()

print("event2 loading")

Player.PlayerGui.Intro2Gui.Frame.Transparency = 0

Player.PlayerGui.Intro2Gui.Frame.Visible = true

TweenGameLabelVisible:Play()

wait(4)

TweenGameLabelInvisible:Play()

TweenFrameInvisible:Play()

game.Workspace.GetJumpscared.GetJumpscared1.Transparency = 1

print("event2 loaded")

end)

and normally that need to show the frame but that not working…

Code is super messy, a lot of unnecessary variables. Recommend re-writing the script, make it simpler by not adding so many variables.

Tweens can go like this,
TweenService:Create(MainLabel, Info, {BackgroundTransparency = 1}):Play() -- Invisible

You can have it as one line, make sure you comment with -- to easily know what you’re looking at.
Gets hard when there’s a lot of variables that you have to go back and forth to.

Server Script:

repeat wait() until workspace.GetJumpscared.GetJumpscared1.Transparency == 1
	
	if workspace.GetJumpscared.GetJumpscared1.Transparency == 1  then
		
		ObjectiveEvent:FireAllClients("") -- Unnecessary Quotes

	end -- Forgot to end your "if statement"

	game.Players.PlayerAdded:Connect(function(Player) -- Moved this out of your previous if statement
		IntroEvent2:FireAllClients()
	end)

IntroEvent.OnServerEvent:Connect(function(Player)
script.Intro:Clone().Parent = Player.PlayerGui
end)

script.Intro.Visible = false
script.Intro.Enabled = false

IntroEvent.OnServerEvent:Connect(function(Player)
script.Intro.Visible = true
script.Intro.Enabled = true
end)

Assuming that you just want to show a frame for all players at a certain time, I would just do something like this:
– Loop through each player, and for each player, clone the IntroFrame
for _, player in pairs(game.Players:GetPlayers()) do
script.IntroFrame:Clone().Parent = player.PlayerGui
end

This will clone the IntroFrame and make it visible to all players.

remote:FireAllClients() exist
if you dont want to do that then use for i,v loop on players

for i,v in pairs(game.Players:GetChildren()) do 
remote:FireClient(v)
end
1 Like

OMG THAT WORKED I LOVE YOUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU THNKS A LOT FR ! Tnks tnks tnks

you are welcome :+1: have a nice day

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.