I have a Gui Bug

so my gui doesn’t work on player pov but it works on server pov.
Example.
player pov:


server pov:

so what’s the problem?
@ketrab2004

1 Like

We need more information, such as where things are in the DataModel as well as what scripts you’re using to do this. Screenshots are great for visualising the problem, but we need to know what’s behind it as well.

2 Likes

Screenshot 2022-12-29 120233

Screenshot 2022-12-29 120131

Screenshot 2022-12-29 121727

You’re changing the StarterGui, not the player’s gui.
Also I think you might be changing the ui from the server which you shouldn’t.

look at player pov the status was " "
in the player pov the status is “Starting soon”
does the script stops at Starting soon command?

In your code you’re changing the StarterGui gui, which is a template that all players get.
However the player’s gui won’t update when the template is updated, so you need to update that from the client.

short explaination: roblox clones every object Instance in StarterGui to a folder named PlayerGui inside every player joined

Screenshot 2022-12-29 125143
what about now?
is that what you mean?

Yes, because .LocalPlayer is nil inside server side scripts, you have to use a localscript.

Look, if you’re trying to change Guis from the server, you can do it. However, you can’t just update the Guis located in the StarterGui container, this is just what the name says “Starter” and all Guis inside it is being cloned for every player that joins the server. read more here.

So, let’s get into the details about how you would change/update Guis from the server.
You would need to iterate every player’s PlayerGui and locate the Gui you want to update and then update it. Here is what I mean:

local Players = game:GetService("Players")

for _, Player in ipairs(Players:GetPlayers()) do
    local PlayerGui = Player:FindFirstChildWhichIsA("PlayerGui")
    if not PlayerGui then continue end   -- Player doesn't have a gui container.
    local MatchBar = PlayerGui:FindFirstChild("Match Bar")
    -- ...              the rest of your code..
end

i tried local script didn’t work.

??? What didn’t work? What was the error? Please give more information in each post.

there wasn’t an error and it didn’t bring me to the game

If you put the localscript in the same location as the server script was it won’t run.
Also you only have to move the changing of ui to the client, resetTeams(), resetBall() and etc. should stay server side.

You can use RemoveEvents to communicate between the server and each client.

so i should remove resetTeams() , resetBall()
and make it local script and move it from the serverscript?

You can send a RemoteEvent to the client from the server each time something needs to be changed.

Then you can keep your server script mostly the same.

1 Like