1

# Why is my number script not working properly?

Edited 5 days ago

Whenever I playtest the game with 2 players, only their number gets shown, but not anyone else's.

For example: 2 players are in the game, they both have BillboardGuis on top of them. Both of those players can see "Your number is: THIS NUMBER" on their character, but when they look at each other's billboards, it just says "Your number is: LOADING...".

Here's the image link to explain it even further: http://pasteboard.co/nmpCqo9GrRD4.png

Here are the scripts I used:

The 1st script:

local billboard = script.BillboardGui

local NumText = billboard:Clone()
end)
end)


The 2nd script:

local billboardamount = game.Players.LocalPlayer.Character.Head:WaitForChild("BillboardGui").TextLabel

local RandNum = Instance.new("NumberValue", game.Players.LocalPlayer)
RandNum.Value = math.random

while wait(0.1) do
billboardamount.Text = "Your number is: "..
end


0

I think issue is that second script is in localscript so it will only show to player, what you should do is you can make remote event and fire it, then put script in serverscriptstorage and onserverevent change text, like this.

LocalScript

local billboardamount = game.Players.LocalPlayer.Character.Head:WaitForChild("BillboardGui").TextLabel

local RandNum = Instance.new("NumberValue", game.Players.LocalPlayer)
RandNum.Value = math.random

while wait(1) do
game.ReplicatedStorage.RemoteEvent:FireServer(RandNum)
end


ServerScript

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player,randnum)