How would I script a Map Changing Text label to show in both Server and Client side

  1. I want to achieve the Map Name chosen for both server/client side.

  2. The issue is, I don’t have a clue where to start when it comes to Remote events and never understand it.

  3. I tried watching videos and reading but I don’t really learn by watching other people telling you to do things. I wish their were a way to practice different situations in scripting.

Thanks for your help!

if you have a string value on the server and then change it on the server it will automatically update to all the clients so you can simply listen for a change of the string value on the client and set the textlabel to the value. Anything that happens on the Server is completely in control of the clients and will replicate to all clients no matter what

Oh then my problem is, the server isn’t updating the text label at all when I Test it.

it should, may I see your code

Yes, let me grab it for you real quick.


local Maps = MapFolder:GetChildren()
local RoundTime = script.RoundTime
local IntTime = script.IntermissionTime
local MapNameHolder = game.StarterGui.ScreenGui.MapDisplay
local player = game:GetService("Players")


while true do 

		local ChosenMap = Maps[math.random(1, #Maps)]
		local MapClone = ChosenMap:Clone()
		local MapSpawn = workspace.MapSpawn
	
		wait(IntTime.Value)
	
	
		MapNameHolder.Text = "Map Chosen: "..ChosenMap.Name
	
		wait(5)
	
		for _, player in pairs(game.Players:GetChildren())do
		local char = player.Character
		char.HumanoidRootPart.CFrame = MapSpawn.CFrame
		end
	
		MapNameHolder.Visible = false
	
	
		MapClone.Parent = game.Workspace
		MapClone:MakeJoints()
	
		wait(RoundTime.Value)
	
		for _, player in pairs(game.Players:GetChildren())do
		local char = player.Character
		char.HumanoidRootPart.CFrame = MapSpawn.CFrame
		end
	
		MapNameHolder.Visible = true
		MapNameHolder.Text = "Round Over...Choosing Next Map!"
		MapClone:Destroy()
		
end```

You cant access a startergui from the server. You need to make a string value in a place where both the client and server can access it such as replicated storage and then change the value of it on the server. You can then listen for changes on the client with a .changed event and simply set the new text on the client.

Can I send a screenshot of what I’m doing, I’m not a very great scripter and I read almost everything.
I put a string value in Replicated Storage

Ok, so basically, make a string value in replicated storage. Change the string value to the desired text such as “Map Chosen”. Then on the client, you can listen for those changes with a .Changed event which you can then use to set the players gui using that new text.

Ohhh so the Server script picks up the value from the Replicated Storage and display it to the clients? After putting a .changed event?

No, the client pickes up the changes and sets the player gui locally as the server script cannot access the player gui. Sorry if this is confusing im not good at teaching.

No man you’re fine, im just dumb.

So basically anything dealing with a GUI, I use local scripts to find the changes I did in a server script , that a regular script cant access? Imma try something simple to make since my understanding is poor. Makes me fustrated when I can’t do simple things.

correct. basically, think of it as a bank. Say I need to withdraw money, I cant just walk in and take it. I need to talk to somebody who does have access and ask for the money. Since he has access, I will request that he gives me the money and he will then transfer the funds from the vault to me. In terms of the client-server model, I am the client, I dont have access directly to the money so I need a bankteller (the remote events and functions), to then transfer the money in the vault (the server) back to me (the client).

1 Like

I got the money from bank teller, that the bank teller got from the vault.
Client got information from remote-event, that came from server.
I think I understand, now I just need to learn how to start the scripts…

1 Like

Thanks for sitting here to help me out with something so simple.

1 Like