How would i be able to make this kind of message pop out when a user joins an experience? Here’s an example.
If you want it to be replicated to all clients, use game.Players.PlayerAdded
on the server and use a RemoteEvent with Event:FireAllClients()
If you only want it to be for the player who joined, make a GUI in StarterGui and it will automatically replicate it. If you want it to not come back after death, disable the property ResetOnDeath
and it should work.
Try looking at this post:
1 Like
Firstly you would a UI template for the message. Then if this message is meant to be displayed to everyone you should use a remote event and fire it to all clients when a player has joined for example:
-- Server Script
-- Services
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Remote Event
local PlayerJoinedEvent = ReplicatedStorage.RemoteEvent -- Create a remote event in ReplicatedStorage
Players.PlayerAdded:Connect(function(player)
PlayerJoinedEvent:FireAllClients(player)
end)
Now on the client you would connect to the remote event like this:
-- Client Side
-- Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- Template
local UITemplate = -- UI location
local PlayerJoinedEvent = ReplicatedStorage.RemoteEvent -- Same as the server
PlayerJoinedEvent.OnClientEvent:Connect(function(player)
print(player.Name.." has joined!")
-- Do what you need with the UI here
end)
Thank you so much for this!!
1 Like