How do you change a client sided gui to server sided

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

1 Like

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.

1 Like

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.

1 Like

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.

1 Like

module scripts are used to organizd scrirpts it will provide the same result

1 Like

how do you invoke servers? i forgot how to do that can you show a sample

robloxapp-20200911-1939386.wmv (2.6 MB)
This is the video of my progress bar

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)
2 Likes