It's probably trash, I don't know a lot about lua yet as I'm only a few days into learning.. It combined two tutorials (one on RemoteEvents triggering a GUI on-screen, and another that makes the text in a GUI become animated like a typewriter).

When a player enters the room with an NPC inside, and their humanoid touches the floor, it triggers a RemoteEvent that is connected to a script inside a ScreenGUI, that enables it so it's seen on-screen. Then it also causes a TextLabel inside a Frame to start writing in TypeWrite.

It does work and displays typewritten text inside the GUI when the player steps on the block, but it duplicates since the player is still on the floor and so it repeats the script. I only want the dialogue to trigger once and then completely go through.

Where I want it to say "what are you doing here?" it says basically "wwwwwwhhhhhaaaaattttt aaaarrrreeee yyyyoooouuuu ddddooooiiiinnnngggg hhhheeeerrrrreeeee???????" It was hilarious the first time, but now it's just frustrating since I can't seem to fix it even after adjusting the wait times. How do I make it so it only runs through once when the player touches the block initially, but not attempt to continue the script on subsequent times? I honestly thought "end" meant that it's the end of the script, and I didn't purposefully put a loop in there. Because I think that's what the problem here is.

Here's the code that seems to be the problem:

game.ReplicatedStorage.Dialogue.OnClientEvent:Connect(function()

	local ReplicatedStorage = game:GetService("ReplicatedStorage")
	
	local TypeWriter = require(ReplicatedStorage:WaitForChild("TypeWriter"))
	
	TypeWriter.configure({
		delayTime = 0.1,
		extraDelayOnSpace = false
	})
	TypeWriter.typeWrite(script.Parent, "...")
	
	wait(5)
	
	TypeWriter.typeWrite(script.Parent, "... what are you doing here?")
	
	wait(5)
end)