How do I continue my TypeWrite Script? [line 31 and below]

Hello!
I’m working on a small fun creation but it’s always coming into issues that if I change one thing or add another an issue occurs elsewhere.
Here is the code for a typewriting script, the issue is on line 31 because I would like to add more typewriting text and also add more movement disabling.

ReplicatedStorage = game:GetService(“ReplicatedStorage”)

local TypeWriter = require(ReplicatedStorage:WaitForChild(‘TypeWriter’))

local ContextActionService = game:GetService(“ContextActionService”)

local PlayerModule = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild(“PlayerModule”))

local Controls = PlayerModule:GetControls()

PlayerModule:GetCameras(false)

Controls:Enable(false)

TypeWriter.typeWrite(script.Parent, “Hello, My name is Canxiety”)

wait(1)

TypeWriter.typeWrite(script.Parent, “I am an AI created by Goldon1sky”)

wait(1)

script.Parent.TextColor3 = Color3.new(0,0,0)
TypeWriter.typeWrite(script.Parent, “Please move to the highlighted area.”)

Controls:Enable(true)
wait(1)

script.parent.Transparency = 1

game.ReplicatedStorage.RemoteEvent.OnClientEvent:Connect(function()
local example = ‘Hello this is a test!’
script.Parent.Transparency = 0

for i=1, #example do
script.Parent.Text = string.sub(example, 1, i)
wait()
end
end)

Here is a video (The Movement unlocked and locked thing I also want to add and it’s in another local script and so far has been mostly working but doesn’t work with line 31 since its a remote event and I don’t know how to make it display the text at the same time as typewriting text)
robloxapp-20210821-1736162.wmv (2.2 MB)

I want this GUI to be working smoothly before I add more and I would appreciate in-depth help because i don’t usually code and i only know some minor basics.

1 Like

The typewriter function is unnecessary as TextLabels have a property called “MaxVisibleGraphemes” which allows you to increase its value over time to slowly reveal text. If, for example, this property was set to 6 on a TextLabel that has its text set to “HelloWorld”, the TextLabel would display the text as “HelloW” (the first 6 characters) instead.

To disable movement, you can simply get the player’s character’s Humanoid and set its WalkSpeed + JumpPower to 0.

Also, when showing code in your posts, you should use the code block function.

-- like this. it looks like "</>" in the text editor's toolbar.
1 Like

I got the control part to work and stuff and I’m using typewriter since it’s easier for me and already put out so I just have to repeat and add a few things to make it work the way I need but thank you :pray:

I might use something else instead of typewriter in the future