I have this height bar script but every player has their own unique gui of their icon which is client sided (other players can’t see it).
How do i make it visible to all the players
How do you make a client sided gui server sided so eveyone can see it
It isn’t possible. You’d have to sync it all together using remote events. Here is a post about it.
i know how to make text server sided but i’m talking about the height bar in toh. I managed to create one but i can only see my self i cant see other player’s progress
local imageGui = game.StarterGui.HeightGui
for i = 1,#game.Players:GetChildren(),1 do
local images = imageGui:Clone()
for i,v in pairs(game.Players:GetChildren()) do
images.Parent = v.PlayerGui
end
end
i tried this but its still the same even though it hasa no errors
Maybe try using module scripts? I’m not too experienced using module scripts so I can’t do too much.
If you want to show how high up other players are you will need to invoke the server. Then when the server returns all the players and their heights you can add them onto the players gui locally.
This is also secure as the only information going through it is already being displayed, its only fetching information.
module scripts are used to organizd scrirpts it will provide the same result
how do you invoke servers? i forgot how to do that can you show a sample
Source:
Tbh I think this can be done without an event, but if you want to relay more data or do more stuff I suppose remote would be useful.
Local Script
local Remote = game.ReplicatedStorage:WaitForChild("PlayerHeights")
local Data = Remote:InvokeServer()
for i = 1,#Data do
local Packet = Data[i]
local Player = Packet[1]
local Height = Packet[2]
-- Add to gui
end
Server Script
local Remote = game.ReplicatedStorage:WaitForChild("PlayerHeights")
local Remote.OnServerInvoke:Connect(function()
local Players = game.Players:GetChildren()
local Data = {}
for i = 1,#Players do
local Char = Players[i].Character
local Height = Char.Head.Position.Y
local Packet = {Players[i],Height}
table.insert(Data,Packet)
end
return Data
end)