Is this a Lag issue?

Hey guys! I hope you do very very well! Being direct:

I am testing a “story game” Gui scripting, but when I test this script on 8 players Server (Roblox Studio Tester) It shows one text for one person and another text to another (It doesn’t show everyone at the same time the different texts but it goes faster or slower for different persons).

The rare thing is that when I try this with 3 players Server It doesn’t show this problem. So I don’t know if It’s a lag issue or in a normal Roblox Server it won’t show this problem.

Example Error:

As you see the player screen in the left is seeing “Wi” and the one on the right is seeing “With everything said, I’ll”.

I think this may be because there’s too much player’s on a single PC (because of Roblox Studio LocalServer) but I’m not sure so here am I asking you.

I’ll appreciate you, your heart and your help if you can give me a hand with this.

My system works in the following order:

1-) A ServerScript changes a ReplicatedStorage BoolValue

2-) A LocalScript detects the Changement and if Its value == true then the LocalScript starts showing the player the Text (Changin the SampleGui.TextLabel.Text)

3-) It fires a RemoteEvent (FireServer) and a ServerScript (OnServerScript) changes another BoolValue (to do different things like making a 30 second round to eat for example or go to sleep)

4-) Another LocalScript continues the loop

I don’t know If It’s my system fault or it’s just a lag problem on Roblox Studio LocalServers

I don’t want the game to have this “lag” issue, and If it is like that on Normal Roblox Server It would be very very bad for my story game.

  • Here’s one of the LocalScripts(Example):
game.ReplicatedStorage:WaitForChild('ActivateRoundMoments').NarratorExplainsHowGameWorks.Changed:Connect(function()
if game.ReplicatedStorage:WaitForChild('ActivateRoundMoments').NarratorExplainsHowGameWorks.Value == true then

	local player = game.Players.LocalPlayer
	local textLabel = player.PlayerGui.NightTest.RuleExplicationText
	
	textLabel.Visible = true
	
	if textLabel.Visible == false then
		textLabel.Visible = not textLabel.Visible
	end
	
	local function typewrite (object, text, length)
		for i = 1, #text,1 do
			object.Text = string.sub(text,1, i)
			wait (length)
		end
	end
	
	wait(3)
	typewrite (textLabel, "Hello everybody...", 0.07)
	wait(1.3)
	typewrite (textLabel, "Let me present myself.", 0.07)
	wait(1.3)
	typewrite (textLabel, "I'm the narrator. And I will be guiding you to play the game correctly.", 0.07)
	wait(1.7)
	typewrite (textLabel, "First, let me explain you the rules.", 0.07)
	wait(1.3)
	typewrite (textLabel, "I will give you 30 s to hide", 0.07)
	wait(1.7)
	typewrite (textLabel, "And if I found you you'll lose ", 0.07)
	wait(1.3)
	typewrite (textLabel, "With everything said, I'll start the countdown", 0.07)
	wait(1.7)
	
	textLabel.Text = " "
	
	textLabel.Visible = false
	
	if textLabel.Visible == true then
		textLabel.Visible = not textLabel.Visible
	end
	
	game.ReplicatedStorage:WaitForChild('RemoteEvents').ActivateCountdown:FireServer()
	
   end
	
end)

  • ServerScript BoolValue Changer(This is an example, It’s not the original one but It does the same work):
wait(3)
for i = 30, 1, -1 do
	i = i - 1
	print(i)
	task.wait(1)
end

print('Loop ended')

game.ReplicatedStorage:WaitForChild('ActivateRoundMoments').NarratorExplainsHowGameWorks.Value = true

  • Player Gui Structure:
    image

I appreciate very very much you and your help, thank you so much, and have a nice day! Bye! :wave: :smiley: :grinning_face_with_smiling_eyes: :wink:

is the text getting stuck at a point, or are they just playing at different times

1 Like

They are just playing at different times

sounds like a lag issue then, since you’re handling 8 players on a single device, some players may have a longer time spawning in or they’ll just lag in general, a good way to test if lag is an issue is to try the same thing with less players and compare results

try playing the game with two players instead of seven and see if it’s more accurate

1 Like

So let’s suppose we’re in a normal Roblox Server (Not Roblox Studio) then this would happen ? (each player is on a different device)

It may not lag and show the results you’ve posted above as a single client is on a single device, and everything else is on the server if that makes sense, the server is optimised to handle multiple clients compared to multiple clients on a client device. i do not fully know if that is completley true though, makes sense to me

To put it simply each client is being connected to a server where they can react with other clients who connected to that server and stuff placed in that server (the game)

1 Like

I tested it and It does not give this “probably lag” issue with 3 LocalServer players (Roblox Studio)

So it was most likely a lag issue then

1 Like

So I don’t have to worry for this happening on Normal Roblox Servers with each player on a different device then?

If anything on the client side lags, then the localscripts will have the effect of lag, and same with servers and server scripts

if you’re using local scripts then if the client lags, the client’s scripts may have a delayed reaction, causing your issue. Since you’re running it on a device that’s not intended to hold multiple individual clients in a single place, it’ll certainly lag

Same applies to the server and their scripts

If each player isn’t lagging, and roblox’s servers don’t experience major issues, then you shouldn’t have to worry by the looks of it

1 Like

Thank you so much! And have a nice day! take care of yourself, my best desires to you and bye! :wave: :grinning_face_with_smiling_eyes: :smiley: :wink: