Is there a way to add a custom option for when you click on a player on the player list?
Example:
Is there a way to add a custom option for when you click on a player on the player list?
Example:
You cannot edit that menu. You would have to create your own player list that looks similar to the core one to add options.
However if you’re just looking for an easy way to add a button that performs an action on a player, Roblox has an avatar context menu that you see when you click on a player or walk up to them. You can add options and callbacks to this menu via game:GetService("StarterGui"):SetCore("AddAvatarContextMenuOption")
function. This menu must also be manually enabled via LocalScript in order to show up in your game. From the wiki:
-- Run in a LocalScript, ideally within "StarterPlayerScripts"
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCore("AvatarContextMenuEnabled", true)
Not interested in the context menu but thank you for informing me.
I’ve done something like this before, but it involves making your own custom Player List. Then, for the Custom Option, you could do something like this:
(I’m not aware that you can send friend requests to other people without using the ROBLOX-made player list, so in this case, you have to make other options)
for i,v in pairs (game.Players:GetChildren()) do
Button.MouseButton1Click:Connect(function()
UI:TweenPosition(UDim.new()) --// Something here
end)
UI.Trade.MouseButton1Click:Connect(function()
Trade:FireClient(v.Name) --// Something here
end)
end
Hope this helps. And other developers, please correct me if I’m wrong.
– Drinkinix
You can. StarterGui.SetCore has an option called PromptSendFriendRequest. If you use this, you can have custom leaderboards that also support sending friend requests. Your code isn’t authoritative though and Roblox still interfaces here with their own backend codebase, but it gets the job done regardless.