Hey, so I am aware there are quite a few topics on this, but I can’t seem to get my finger properly around it.
-- \\ VARIABLES \\
local Player = game:GetService("Players").LocalPlayer
local PlayerGUI = Player.PlayerGui
local AMann = PlayerGUI:WaitForChild("AMAnnouncement")
local AMFrame = AMann:WaitForChild("AMFrame")
local RemoteEvent = game.ReplicatedStorage.AMEvent
local AMLabel = AMFrame.AMLabel
-- \\ CATCHES WHEN ADONIS IS FIRED \\
RemoteEvent.OnClientEvent:Connect(function(message)
local Label2 = AMFrame.AMLabel.AMLabel2
Label2.Text = message
local TS = game:GetService("TweenService")
-- \\ TWEEN CONFIGURATION \\
local tInfo = TweenInfo.new(
5, -- Time/Speed
Enum.EasingStyle.Quint, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
-- \\ CREATES TWEENS \\
local FadeIn = TS:Create(AMLabel, tInfo, {ImageTransparency = 0})
local FadeOut = TS:Create(AMLabel, tInfo, {ImageTransparency = 1})
FadeIn:Play()
local Label2 = AMFrame.AMLabel.AMLabel2
Label2.Text = message
Label2.Visible = true
wait(3)
Label2.Visible = false
FadeOut:Play()
end)
This is my script I have so far, to fade and fade out a Tween, I really have no clue what’s going wrong as I’ve used this script twice, the first one worked, the second didn’t.
Please do explain your response so I can fully capture what you mean
Alright, allow me to send both scripts, the scripts are quite messy with variable names, that’s my focus after this, that’s the first use of the script, this is the second use:
-- \\ VARIABLES \\
local Player = game:GetService("Players").LocalPlayer
local PlayerGUI = Player.PlayerGui
local AMann = PlayerGUI:WaitForChild("QAAnnouncement")
local AMFrame = AMann:WaitForChild("QAFrame")
local RemoteEvent = game.ReplicatedStorage.QAEvent
local AMLabel = AMFrame.QALabel
-- \\ CATCHES WHEN ADONIS IS FIRED \\
RemoteEvent.OnClientEvent:Connect(function(message)
local Label2 = AMFrame.QALabel.QALabel2
Label2.Text = message
local TS = game:GetService("TweenService")
-- \\ TWEEN CONFIGURATION \\
local tInfo = TweenInfo.new(
5, -- Time/Speed
Enum.EasingStyle.Quint, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
-- \\ CREATES TWEENS \\
local InFade = TS:Create(AMLabel, tInfo, {ImageTransparency = 0})
local OutFade = TS:Create(AMLabel, tInfo, {ImageTransparency = 1})
InFade:Play()
Label2.Visible = true
wait(3)
OutFade:Play()
Label2.Visible = false
end)
I would try making a for loop for all the players in the server and just use :FireClient() and pass the player from the for loop. I tried simplifying your code in studio and im also having trouble getting it to work.
I would also try adding a small delay for all the elements to load, including the label and the remote event, mixed with a small task.wait() could work, worked for me at least.
Here’s the code if your interested:
Server:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Lol = ReplicatedStorage:WaitForChild("RemoteEvent")
task.wait(1)
Lol:FireAllClients("Hello")
Local:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Lol = ReplicatedStorage:WaitForChild("RemoteEvent")
Lol.OnClientEvent:Connect(function(msg)
print(msg)
end)
I did a little bit of digging and discovered something quite odd, when I put the AMFrame & AMLabel to Visible before joining Studio Testing, it worked fine.
But when I tried hiding the UIs and joining studio testing, it didn’t seem to work.
I think you just forget to turn the visibility back on when joining lol. Just make them visible but set the transparency to 1. Or set the visibility back to true at the last second.