Hey guys I really do not know what I’m doing wrong here, everything is supposed to work as intended. So I basically fired a remote event from a server script so I can alert the player if a command failed. It didnt work, like I literally printed message and object right above the tween once and it showed the correct value
It showed me that everything had been passed down correctly.
It’s just that the tween is not working.
local TweenService = game:GetService("TweenService")
local MessagePlayer = game:GetService("ReplicatedStorage").Events.UI.MessagePlayer
local MessageAllClients = game:GetService("ReplicatedStorage").Events.UI.MessageAllClients
local Group = game:GetService("StarterGui").dev.alerts.notify
local function sendtoplayer(message,object)
local Debounce = true
for _, TextLabel in pairs(Group:GetChildren()) do
if TextLabel.Name == object then
TextLabel.Text = tostring(message)
print(TextLabel.Text, object)
if Debounce then
Debounce = false
TweenService:Create(TextLabel, TweenInfo.new(1), { TextTransparency = 0 }):Play()
TweenService:Create(TextLabel.UIStroke, TweenInfo.new(1), {Transparency = 0 }):Play();task.wait(3)
TweenService:Create(TextLabel, TweenInfo.new(1), { TextTransparency = 1 }):Play()
TweenService:Create(TextLabel.UIStroke, TweenInfo.new(1), {Transparency = 1 }):Play()
Debounce = true
end
end
end
end
local function sendtoallclients(message)
return nil
end
MessagePlayer.OnClientEvent:Connect(sendtoplayer)
MessageAllClients.OnClientEvent:Connect(sendtoallclients)
My original script was through the use of modular scripts(that brought problems of its own,inheritance etc) please help me.
I have everything defined I just sent a snippet of my code
local TweenService = game:GetService("TweenService")
local MessagePlayer = game:GetService("ReplicatedStorage").Events.UI.MessagePlayer
local MessageAllClients = game:GetService("ReplicatedStorage").Events.UI.MessageAllClients
local Group = game:GetService("StarterGui").dev.alerts.notify
local function sendtoplayer(message,object)
local Debounce = true
for _, TextLabel in pairs(Group:GetChildren()) do
if TextLabel.Name == object then
TextLabel.Text = tostring(message)
print(TextLabel.Text, object)
if Debounce then
Debounce = false
TweenService:Create(TextLabel, TweenInfo.new(1), { TextTransparency = 0 }):Play()
TweenService:Create(TextLabel.UIStroke, TweenInfo.new(1), {Transparency = 0 }):Play();task.wait(3)
TweenService:Create(TextLabel, TweenInfo.new(1), { TextTransparency = 1 }):Play()
TweenService:Create(TextLabel.UIStroke, TweenInfo.new(1), {Transparency = 1 }):Play()
Debounce = true
end
end
end
end
local function sendtoallclients(message)
return nil
end
MessagePlayer.OnClientEvent:Connect(sendtoplayer)
MessageAllClients.OnClientEvent:Connect(sendtoallclients)
You’re editing the labels in StarterGui, this is the problem. You need to edit each player’s PlayerGui. I’d suggest using a RemoteEvent to tell the clients what to and when to play the tween.