Server side
print('Sending from server') -- prints once
DisplayVictory:FireAllClients(Settings.TEAMS, winner)
Client side
local function ShowVictory(teams, winner)
print('Victory sent') -- prints twice
EndGame.Visible = true
Menu.Visible = false
wait(4)
EndGame.Visible = false
Menu.Visible = true
end
DisplayVictory.OnClientEvent:Connect(ShowVictory)
Note, the client is inside a GUI. The GUI is not stored in StarterGui, but in StarterPlayer, as I don’t load the character in from the start. Thus I have to manually parent the GUI to the player.
local HUD = script:WaitForChild('HUD')
local HUDClone = HUD:Clone()
HUDClone.Parent = PlayerGui
PlayerCanRespawn.OnClientEvent:Connect(function()
local OriginalHUD = PlayerGui:FindFirstChild('HUD')
if OriginalHUD then
OriginalHUD:Destroy()
end
HUDClone = HUD:Clone()
HUDClone.Parent = PlayerGui
CameraManipulation:Menu(false)
end)
GUI is also set to ResetOnSpawn false