Notification UI

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    I wanted to create an notification that shows on thr player not for everyone, if you enter a custom command that you made it will notifys the user example /respawn Notification UI will show and kt will says “Respawn requested”

  2. What is the issue? I cannot find tutorials YouTube

  3. What solutions have you tried so far? i found nothing on forum and tried to script but it didn’t worked

1 Like

Firstly, you need a server-side script to detect the command.

In order to make it only show for one client, you need to make the necessary GUI under StarterGui, and have a RemoteEvent in ReplicatedStorage. This would be what it might look like server-side:

--where the 'player' variable is the desired player object and 'text' variable is the desired text
game.ReplicatedStorage.RemoteEvent:FireClient(player, text) --change to your remote event

Now, make sure that the client-side TextLabel is enabled, but Visible is set to false.

Put a LocalScript under the designated TextLabel and connect it to the remote event.

local event = game.ReplicatedStorage:WaitForChild("RemoteEvent") --change to your event

event.OnClientEvent:Connect(function(text)
    script.Parent.Visible = true
    script.Parent.Text = text
    wait(2)
    script.Parent.Visible = false
end)
3 Likes

What the code will do is fire the event from the server, and the player variable tells the server which client to deliver the information to.

Then, when the client receives the information, it will set the notification TextLabel’s Text property to whatever was passed down the RemoteEvent. You can modify what it will change to in the server-side script.

Download
Notifications.rbxm (2,9 КБ)

or

Get

2 Likes

How would i use them? I don’t know how

This is the system I use for my commands:

Server Script

local replicated = game:GetService("ReplicatedStorage")
local remote = replicated:FindFirstChild("RemoteEvent")

game.Players.PlayerAdded:Connect(function(player)
  player.Chatted:Connect(function(message)
  	if message:lower():sub(1,8) == '/respawn' then
  		remote:FireClient(player)
  	end
  end)
end)

Local Script

local replicated = game:GetService("ReplicatedStorage")
local remote = replicated:WaitForChild("RemoteEvent")
debounce = false

remote.OnClientEvent:Connect(function(Message)
	if debounce == false then
		debounce = true
		wait(.1)
		game.StarterGui:SetCore("SendNotification",{
		Title = "Success!",
		Text = "Respawn requested.",
        Time = 5 ---time in seconds
		})
		wait(10)
		debounce = false
	end
end)

Thanks! but this wasn’t i was looking for :slight_smile:

I was looking for an actual UI’s not an default roblox built. I wanted to achive something similar on the picture
image

Your gonna have to make the UI yourself probably. But are you looking on how to make the UI or the script(s)?

i was looking out for an tutorial or a script

Well to get the message from the chat, you can do something like this;

--- Server Script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage:WaitForChild("Event")

game:GetService('Players').PlayerAdded:Connect(function(Player)
	Player.Chatted:Connect(function(Message)
		if Message == "/Respawn" then
			Event:FireClient(Player)
		end
	end)
end)

--- Local Script

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage:WaitForChild("Event")

Event.OnClientEvent:Connect(function()
	--Update GUI
end)

And then simple Update the GUI however you need. (Updated)

1 Like