I am trying to make a tool. A coffee. And if you left click on a player in a set range, it should make a UI show on his screen. As far as I know I need a local script for the tool, then it fires a RemoteEvent which then activates a script to make the UI show for the „target“ person. The UI will look like spilled coffee. How can I 1st find out who is the 2nd player. 2nd how can I acces HIS UI?
#How to Access other player
1 messages · Page 1 of 1 (latest)
You can use a remote event from the client to the server and another one from the server to the other player. Like this:
Player1
RemoteEvent:FireServer(Player2)
Server
RemoteEvent.OnServerEvent:Connect(function(Player)
RemoteEvent:FireClient(Player2, Player)
end)
Player2
RemoteEvent.OnClientEvent:Connect(function(Player)
-- make some ui changes to player2 (player1's target)
end)
to get the UI of any playet
** You are now Level 9! **
so I make a local script inside of the tool with a function that activates a remote event when the player2 gets clicked. Then I make a server script on ServerScriptService with the 2nd thing you said but where do I put the last parts?
And how do I make the target? Does the game know that player 2 is the target or do I have to definate it first?
the last part you can put in a local script in starterplayerscripts or startercharacterscripts or backpack. anywhere where it runs
or startergui