Hello, I Have a problem with my script, i made a script that counts the player’s torso size to make a game like Agario, so the problem is the other players can’t see others’ size, If you can help please reply.
Are you updating them with a local script, if so this only makes the changes on the one client. It needs to be done on the server, or every client individually
i tried both, local script and script, i tried local script first in startercharacter and StarterGUI, didn’t work, and tried script in serverscriptservice, didn’t work too, what should i do?
Ok first off, you didnt put your code in the post, unless its invisible.
Second what you should do is this:
With a server script whenever a players character is added, add the billboard GUI to it, then when ever their score or whatever changes, update the text there.
– Place this script in a Script inside ServerScriptService
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoidRootPart = character:WaitForChild(“HumanoidRootPart”)
-- Create the BillboardGui
local billboardGui = Instance.new("BillboardGui")
billboardGui.Name = "BillboardGui"
billboardGui.Size = UDim2.new(0, 200, 0, 50) -- Adjust size as needed
billboardGui.StudsOffset = Vector3.new(0, 5, 0) -- Position above the player
billboardGui.AlwaysOnTop = true
billboardGui.Parent = humanoidRootPart
-- Create the TextLabel
local textLabel = Instance.new("TextLabel")
textLabel.Name = "TextLabel"
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.BackgroundTransparency = 1
textLabel.TextColor3 = Color3.new(1, 1, 1) -- Set text color
textLabel.TextStrokeTransparency = 0.5
textLabel.TextScaled = true -- Ensure text scales properly
textLabel.Text = "" -- Initialize with an empty string
textLabel.Parent = billboardGui
-- Function to update the TextLabel with the torso size
local function updateSize()
local torsoPart = character:FindFirstChild("Torso") or character:FindFirstChild("UpperTorso") -- Adapt for R6 or R15
if torsoPart then
textLabel.Text = "Torso Size: " .. string.format("%.2f, %.2f, %.2f", torsoPart.Size.X, torsoPart.Size.Y, torsoPart.Size.Z)
else
textLabel.Text = "Torso Size: N/A"
end
end
-- Initial update and connect for future updates
updateSize()
-- Connect changes to the size of the torso
local torsoPart = character:FindFirstChild("Torso") or character:FindFirstChild("UpperTorso")
if torsoPart then
torsoPart:GetPropertyChangedSignal("Size"):Connect(updateSize)
end
-- Handle character respawning and remove the GUI
player.CharacterRemoving:Connect(function()
billboardGui:Destroy() -- Clean up the GUI when the character is removed
end)
end)
– Place this script in a Script inside ServerScriptService
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoidRootPart = character:WaitForChild(“HumanoidRootPart”)
-- Create the BillboardGui
local billboardGui = Instance.new("BillboardGui")
billboardGui.Name = "BillboardGui"
billboardGui.Size = UDim2.new(0, 200, 0, 50) -- Adjust size as needed
billboardGui.StudsOffset = Vector3.new(0, 5, 0) -- Position above the player
billboardGui.AlwaysOnTop = true
billboardGui.Parent = humanoidRootPart
-- Create the TextLabel
local textLabel = Instance.new("TextLabel")
textLabel.Name = "TextLabel"
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.BackgroundTransparency = 1
textLabel.TextColor3 = Color3.new(1, 1, 1) -- Set text color
textLabel.TextStrokeTransparency = 0.5
textLabel.TextScaled = true -- Ensure text scales properly
textLabel.Text = "" -- Initialize with an empty string
textLabel.Parent = billboardGui
-- Function to update the TextLabel with the torso size
local function updateSize()
local torsoPart = character:FindFirstChild("Torso") or character:FindFirstChild("UpperTorso") -- Adapt for R6 or R15
if torsoPart then
textLabel.Text = "Torso Size: " .. string.format("%.2f, %.2f, %.2f", torsoPart.Size.X, torsoPart.Size.Y, torsoPart.Size.Z)
else
textLabel.Text = "Torso Size: N/A"
end
end
-- Initial update and connect for future updates
updateSize()
-- Connect changes to the size of the torso
local torsoPart = character:FindFirstChild("Torso") or character:FindFirstChild("UpperTorso")
if torsoPart then
torsoPart:GetPropertyChangedSignal("Size"):Connect(updateSize)
end
-- Handle character respawning and remove the GUI
player.CharacterRemoving:Connect(function()
billboardGui:Destroy() -- Clean up the GUI when the character is removed
end)
end)
Ok then uh, you have some of the weirdest scripts ever, cause they should update on all clients. You are 100% sure that this is the case? (PLEASE DOUBLE CHECK). If so do you have any local scripts that would be changing the text? If so delete them.