Remote function not returning anything if it takes too long

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

A message system for my character jeruld

  1. What is the issue? Include screenshots / videos if possible!

In the main place, it works completely

Server:

local chat = game.ReplicatedStorage.Chat

script.Parent.MouseClick:Connect(function(plr)
	game.ReplicatedStorage.FireCutsceneBad:FireClient(plr)
	print("sent")
	task.wait(2)
	repeat task.wait() until chat:InvokeClient(plr,"You fool")
	repeat task.wait() until chat:InvokeClient(plr,"You have invoked")
	repeat task.wait() until chat:InvokeClient(plr,"MY WRATH!!!!")
	game.BadgeService:AwardBadge(plr.UserId,"800720236877854")
	plr:Kick("ENDING COMPLETE: BAD ENDING")
end)

Client:

game.ReplicatedStorage.Chat.OnClientInvoke = function(msg)
	script.Parent.Parent.Visible = true
	local letters = string.split(msg,"")
	print(letters)
	for i,letter in letters do
		script.Parent.Text = script.Parent.Text..letter
		task.wait(0.05)
	end
	task.wait(3)
	script.Parent.Text = ""
	script.Parent.Parent.Visible = false
	return true
	
	
end

But in my second place (with the exact same script)
it only works if instead of task.wait(3) it is task.wait(1)
what’s even stranger is that previously it worked but it just stopped

For some reason, when I play the games #1 place it works completely

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I’ve tried changing the time and it works but I need the time to be 3, I searched things on dev hub but there is nothing

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Everything except the return function works, if you have a print function one line before, it prints after 3 seconds but the return but just doesn’t

1 Like

I sometimes had issues with StreamingEnabled, is it on in one place and off in the other? I suggest changing up the settings or simply just turning it off.

1 Like

InvokeClient already yields until it returns something

1 Like

They are on in both with the exact same settings

1 Like

Yeah, tried that, no difference

1 Like

can someone please help me with this, It’s still happening

Send over the rbxl files, I’ll try some possible solutions