“Server Script” goes under ServerScriptService
“Client Script” goes in your GUI or in your Callsign TextBox
and to get a persons Callsign when you click on a name in the list, just add this to your TextButton’s clicked event: (This assumes that “Player” is the Player instance the TextButton represents)
(And that SignLabel is the TextLabel that displays the callsign)
SignLabel.Text = Player:GetAttribute("Callsign") or Player.DisplayName
local Remote = Instance.new("RemoteFunction")
Remote.Name = "CallsignEvent"
Remote.Parent = game:GetService("ReplicatedStorage")
local TextService = game:GetService("TextService")
local Players = game:GetService("Players")
local function FilterText(Text, UserId)
local FilterResult
local Success, Failure = pcall(function()
FilterResult = TextService:FilterStringAsync(Text, UserId)
end)
if Success then
return FilterResult
elseif Failure then
print("TextService:FilterStringAsync() failed:", Failure)
end
return nil
end
Remote.OnServerEvent:Connect(function(Player, Callsign)
if type(Callsign) ~= "string" then return end
if string.len(Callsign) == 0 then return end
local FilterObject = FilterText(Player.UserId)
if FilterObject then
local FilteredString
local Success,Failure = pcall(function()
FilteredString = FilterObject:GetNonChatStringForBroadcastAsync()
end)
if Success then
Player:SetAttribute("Callsign", FilteredString)
end
end
end)
Now the text label is returning the players name and not the players callsign
heres the script
currentofficersreplication.Button.MouseButton1Click:Connect(function()
local Player = game:GetService("Players"):FindFirstChild(currentofficersreplication.Callsign.Text)
officercallsign.Text = Player:GetAttribute("Callsign") or Player.DisplayName
end)
They haven’t put a Callsign in yet then.
And also, use this code.
currentofficersreplication.Button.MouseButton1Click:Connect(function()
local Player = game:GetService("Players"):FindFirstChild(currentofficersreplication.Button.Text)
officercallsign.Text = Player:GetAttribute("Callsign") or Player.DisplayName
end)
The only change I made was to which Text you were using to get the Player. You were using Callsign.Text but you were clicking a button that you’ve previously said has its .Text set as their Name.
You really need to show us the Explorer window of this GUI. It’s so hard to help you just hoping you get everything right and I have no idea how it should work.