How do I stop the wait() function from giving players delay

  1. Since the wait function changes if you run it for 2 players at the same time there will be a delay between the 2 players. How do I fix this?? is there an alternative to wait that has no or less of a delay?
if timer.Value == 45 then
		mrsface()
		wait(3)
		typeWritter(textLabel, "Hey kids, welcome to the trampoline park")
		wait(3)
		typeWritter(textLabel, "My name is Jane and I am currently taking care of this place")
		wait(3)
		remote()
		typeWritter(textLabel, "Hey Jane, me and my friends were invited here. It will be so fun!!")
		wait(3)
		remote()
		typeWritter(textLabel, "could you let us in please??")
		wait(3)
		mrsface()
		typeWritter(textLabel, "Yes of course.. I just need to find my keycard.")
		wait(3)
		typeWritter(textLabel, "Could you please help me find my keycard??")
		wait(3)
		remote()
		typeWritter(textLabel, "Of course!! We love to help")
		tweenQuest()
end

Please include your full script, your if statement isn’t even finished.

1 Like

You could add a RemoteEvent that would be sent to the clients and have the clients wait for it.

DialogueStartEvent.OnClientEvent:Connect(function() [CODE GOES HERE] end)

I don’t think this will solve the problem because it’s doing the exact same thing

I see. What exactly do you mean by “the wait function changes”?

1 Like

I don’t think you would need the full script as I am asking for a way to make the wait() delay smaller. If you don’t already know a wait function does not necessarily wait the proper amount of seconds.

Well, I don’t really think there is a solution to delay. Different clients receive server updates at different times. As @bigha_rn said, I do believe implementing a RemoteEvent would be the best fix. There is no way to make the timing perfect, although I do believe that perhaps you should delay what happens AFTER the event by a second or two so then all clients are updated at once?

TL:DR, Wifi can be good or bad, RemoteEvents is the best route in my opinion.

2 Likes

I am pretty sure that if you say for example wait(10) it might have a delay every time it’s waiting which means it might end up waiting 11 seconds instead of 10. That would make a delay between they player’s text.

I will try the remote event and be back. I don’t think it will be a big difference but It might make it slightly cleaner.

yes this actually reduced the delay quite a lot. Thanks to both since I would put solution for both of you but since bigha said it first he deserves it

1 Like