Does the Boss dies and then the typewriter effect on GUI work or not?

Hey guys, I want to make the action when the boss of the boss battle dies, the typewriter script will activate.

but I came across some issues because I am not sure if these scripts are not working? If I’m wrong, you guys can make corrections on the script.

This script was a localscript and was put inside the text of the GUI.

local textLabel = script.Parent.Parent:WaitForChild("TextDisplayLBL")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage:WaitForChild("BossDefeated")

local function typewrite(object,text,length)
	for i = 1,#text,1 do
		object.Text = string.sub(text,1,i)
		wait(length)
	end
end

Event.OnClientEvent:Connect(function(player)
	typewrite(textLabel,"wait! please stop!",0.02)
	typewrite(textLabel,"I'll give up!!",0.02)
end)

text is a string, not a table, so you can’t do #text

You can use # to obtain the length of a string or table.

print(#"hello world") -- 11

@awyuxuanremix Are there any errors in the output? Are you sure you are using RemoteEvent:FireClient or RemoteEvent:FireAllClients in a Script?

The issue isn’t in this script - It all seems to be fine.

Have you checked your Server Script? Perhaps print a message before the remove event fires to see if it actually reaches that point