How would I start with a UI that is visible to two players?

Hi, I have resently been trying to advance my skills a little bit. I was trying to make a UI that is visible to two players and only those 2 players. I have been experimenting with the .onClientEvent and then try to make it work for 2 player. But now I am a bit stuck on how to go now. This is my code:

Code:

-- Variables
local Player1 = nil
local Player2 = nil
local Storage = game.ServerInstanceStorage
local Event = Storage.Events.OpenTradeUI

-- Code
Event.OnClientEvent:Connect(function(plr1, plr2)
	Player1 = plr1
	Player2 = plr2
end)

Is there somebody that could help me?

I made a little bit more procces so this is were I am at now. I am not sure if this is the best way to go so could someone help me maybe?

(I have renamed the workspace to “WorldWithAllThePartsInIt” and the Players to “PlayersThatPlayTheGameCurrently”)

Code:

-- Variables
local Player1 = nil
local Player2 = nil
local Storage = game.ServerInstanceStorage
local Event = Storage.Events.OpenTradeUI

-- Code
Event.OnClientEvent:Connect(function(plr1, plr2)
	Player1 = game.PlayersThatPlayTheGameCurrently:GetPlayerFromCharacter(game.WorldWithAllThePartsInIt:FindFirstChild(plr1))
	Player2 = game.PlayersThatPlayTheGameCurrently:GetPlayerFromCharacter(game.WorldWithAllThePartsInIt:FindFirstChild(plr2))
	
	Player1.PlayerGui...
	Player2.PlayerGui...
end)
´´´

I would send two remote events on the server to the clients that should see the gui.

Server:

-- Variables
local Player1 = nil
local Player2 = nil
local Storage = game.ServerInstanceStorage
local Event = Storage.Events.OpenTradeUI

-- Once you know which to players should see the gui:
Event:FireClient(Player1)
Event:FireClient(Player2)

Client:

Event.OnClientEvent:Connect(function() --When client recieves event, it makes the gui visible
    GuiToMakeVisible.Visible = true
end)

Does this also work if I want the players to interact with the same UI?

The two guis will be different objects, so if one player changes the text for example, the other client won’t see it. To solve this, you need to send a remote event to the server and then the server sends a remote event to the other client so he changes the text.
I recommend you to learn more about client and server scripting.