I am having this problem with FireAllClients() where I check if inRound.Value is true or false. And I sent a remote even to client based on the condition
[Server]
function module.teleportPlayers(map)
if inRound.Value then
TweenHUD:FireAllClients("In")
else
print("Game Over!")
TweenHUD:FireAllClients("Out")
end
After this is fired I check on the client which string was used and call a function accordingly.
[Client]
TweenHUD.OnClientEvent:Connect(function(State)
if State == "In" then
inGame()
elseif State == "Out" then
outGame()
end
end)
The inGame() function basically checks if the inRound.Value == true and calls the function which is
function inGame()
for i, v in pairs(LobbyHUD:GetChildren()) do
local XVal = v:FindFirstChild("XVal")
local YVal = v:FindFirstChild("YVal")
TweenHandler:MoveFrame(v, XVal.Value, YVal.Value)
end
task.wait(2)
for i, v in pairs(BattleHUD:GetChildren()) do
if v.Name ~= "Frame" then
local YVal = v:FindFirstChild("YVal")
local XVal = v:FindFirstChild("XVal")
local YValClose = v:FindFirstChild("YValClose")
TweenHandler:MoveFrame(v, XVal.Value, YVal.Value)
end
end
end
I have a “YVal”, “XVal”, and “YValClose” value stored in each frame and used it to tween them. My problem is that when I call the function it will glitch out and only tween like 1 or 2 of them when there is 5.
The BattleHUD explorer looks like:
The LobbyHUD explorer looks like:
Now each frame in the HUD’s is supposed to tween out and then back in when the inRound.Value is true/false.
This is the LobbyHUD GUI:
And this is the BattleHUD GUI: