Text not working after death

Hi! I’m currently having trouble with my Gui. When you reset then the text just stops updating. I used a tutorial for a typewriter affect and if you die/reset while its still typing, the entire thing just stops.

I have tried looking on the devforum and yes I did set the resetonspawn to false on the screengui.

I have no idea how to fix this.

Local Script:

local function Type(Gui, Text, Time)
	for i = 1,#Text,1 do
		Gui.Text = string.sub(Text,1,i)
		if i == "." then
			wait(1)
		end
		wait(Time)
	end
end

workspace.RemoteEvent6.OnClientEvent:Connect(function(msg)
	
	local T = game.Players.LocalPlayer.PlayerGui.System.MessageFromSystem.TextLabel
	if msg == "-setgame Hide and Seek" then
		T.Parent.Visible = true
	Type(T, "Game Chosen: Hide and Seek.", 0.07)
	wait(3)
		Type(T, "Hide and seek is a game where Ash or Godly may try to hunt you and find you.", 0.05)
		wait(3)
		Type(T, "A random lucky person may also be chosen to hunt along, or may do it with another player as Godly and Ash supervise.", 0.03)
		wait(4)
		Type(T, "You may NOT team with any seekers if you are a hider as this is unfair to other people playing. Also you can steal someone's hiding spot even if they are protesting against it.", 0.04)
		wait(3.5)
		Type(T, "Now with that said, may the game begin.", 0.04)
		wait(3.5)
		T.Parent.Visible = false
		workspace.RemoteEvent7:FireServer("Hide and Seek")

This is a small part of my code.

Wait is the serverScript in the PlayerGui?

oh my mistake, I meant to say its a local script.

Okay, so Local script, in a ScrenGUI/PlayerGUI, and the screenGUI has resetonspawn to false, correct?

That is indeed correct, I checked.

Maybe put this in the serverScript that calls RemoteEvent6, and just loop through each player, because RemoteEvent7 just goes back to server, which I think is pointless.

Also, a rule of thumb, RemoteEvents go in the ReplicatedStorage, don’t rely on the client to send the Server a message, as the client may leave the game.

And an FYI, you can use RemoteEvent6 to both, send a message to a/all client(s), and send a message to the Server.

However this information may or may not help, as I don’t specifically know how your code works/functions, or how it is intended to work/function.

If you would like I can show you a recording of what the code results in.

Yeah, that could help.

Character limit.

Ok, I have a recording and I showed how resetting breaks it.
hope this helps

(file was too big so I thought youtube was the easiest way out)

1 Like

What error messages come up in the console?

none come up.

Character limit : /


by the way this is the script that fires RemoteEvent6.

I think you should just loop through the Players that will see the text from the Server and see if that works.

Depending on how the server is running, definitely don’t do what I said above, just don’t rely on a client to send the RemoteEvent7:FireServer("Hide and Seek") event.

Other than that, and moving the events to ReplicatedStorage, I don’t know how to fix this.

1 Like

Oh alright, I’ll try that then.

So would I put the events into one big server script?

Sorry, what do you mean by that?

Like the local script sends a “Hide and Seek” event into a server script. So if i don’t rely on the client, would I just put it all in the server?

Still send the info to the Client, but on the server, use a wait statement, so that the Server doesn’t rely on a client and can’t get influenced by a hacker.

Disable ResetOnSpawn


I’ve already done that, but it didn’t work.