Answered by
pwx 1581
1 year ago
It's ideal that you use FireAllClients() with a RemoteEvent.
Put a RemoteEvent in ReplicatedStorage, be sure to name it whatever you want and edit the script accordingly.
ServerScript - Be sure to put this in ServerScriptService
1 | local replicatedStorage = game:GetService( 'ReplicatedStorage' ) |
3 | local Remote = replicatedStorage:WaitForChild( 'RemoteEvent' ) |
5 | Remote:FireAllClients( 'U are cool' ) |
LocalScript - Be sure to put this in StarterPlayerScripts
01 | local replicatedStorage = game:GetService( 'ReplicatedStorage' ) |
02 | local Players = game:GetService( 'Players' ) |
03 | local Player = Players.LocalPlayer |
05 | local Remote = replicatedStorage:WaitForChild( 'RemoteEvent' ) |
07 | Remote.OnClientEvent:Connect( function (Message) |
08 | local warnUI = Player.PlayerGui:FindFirstChild( 'Warnui' ) |
10 | warnUI.TextLabel.Text = Message |