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)
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)
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.