i set the sign names to [Player Name]'s Plot
on the server but i’m trying to change it to Your Plot
on the client for the person that owns the plot. i have no idea how to do it and i can’t find any resources on it unfortunately.
i have signID
attributes in both the plot and the sign to distinguish what plot owns what sign:
server side:
function PlotManager:GivePlot(player : Player)
for _, plot in plots:GetChildren() do
if plot:GetAttribute("taken") then continue end
plot:SetAttribute("taken", true)
plot:SetAttribute("owner", player.UserId)
local newPlotTag = PlotTag:Clone()
newPlotTag.Parent = plot
local frame = newPlotTag:FindFirstChild("Frame")
local name = frame:FindFirstChild("name")
local stroke = frame:FindFirstChild("stroke")
local avatarImage = frame.avatarImage
local image = nil
name.Text = player.DisplayName
stroke.Text = player.DisplayName
--local hue = math.random()
--print("hue: "..hue)
--frame.BackgroundColor3 = Color3.fromHSV(hue, 1, 1)
local success, errorMsg = pcall(function()
image = players:GetUserThumbnailAsync(
player.UserId,
Enum.ThumbnailType.HeadShot,
Enum.ThumbnailSize.Size100x100
)
end)
if success then
avatarImage.Image = image
else
warn("failed to get avatar image for "..player.Name, ": ", errorMsg)
end
local PlotSignID = plot:GetAttribute("SignID")
for _, sign in ipairs(PlotSigns:GetChildren()) do
if sign:GetAttribute("SignID") == PlotSignID then
local SignText = sign:FindFirstChild("TextLabel", true)
if SignText then
SignText.Text = player.DisplayName.."'s Plot"
end
break
end
end
-- 🔹 Fire RemoteEvent to update client-side signs
PlotAssigned:FireAllClients({
playerUserId = player.UserId,
displayName = player.DisplayName,
plotName = plot,
SignID = PlotSignID,
})
print("plot has been given to "..player.Name.."!")
break
end
end
client side:
-- Define the function FIRST
function BillboardManager:UpdateClientPlotName()
for _, plot in ipairs(plots:GetChildren()) do
local ownerId = plot:GetAttribute("owner")
local plotSignID = plot:GetAttribute("SignID")
if not ownerId or not plotSignID then continue end
-- Update BillboardGui name on plot
local PlotTag = plot:FindFirstChild("PlotTag")
if PlotTag and PlotTag:IsA("BillboardGui") then
local frame = PlotTag:FindFirstChild("Frame")
local name = frame and frame:FindFirstChild("name")
local stroke = frame and frame:FindFirstChild("stroke")
if ownerId == player.UserId then
if name then name.Text = "Your Plot" end
if stroke then stroke.Text = "Your Plot" end
end
end
for _, sign in ipairs(PlotSigns:GetChildren()) do
if sign:GetAttribute("SignID") == plotSignID then
local surfaceGui = sign:FindFirstChild("SurfaceGui")
local SignText = surfaceGui and surfaceGui:FindFirstChild("TextLabel")
if SignText then
SignText.Text = "Your Plot"
end
break
end
end
end
end
PlotAssigned.OnClientEvent:Connect(function(plotData)
if plotData and plotData.playerUserId == player.UserId then
-- Only update if it's YOUR plot that got assigned
print(plotData)
BillboardManager:UpdateClientPlotName()
end
end)