E to skip multiple times

Hi! I’m trying to do Intro when joining the game. There will be a message, and couple seconds later, a SubText shows up with a message “Press “E” to skip.” Once clicking E, another text starts appearing, wait couple seconds and you can skip with E! But I have no idea how to do that.

Edit: i rewrote this entire thing, it was confusing.

2 Likes
local sg = game:GetService("StarterGui")
local uis = game:GetService("UserInputService")

local label = nil -- change nil to the refernce of your label
local nextLabel = nil -- change nil to your next labe after skipping

uis.InputBegan:Connect(function(input, gameProcessed)
	if input == Enum.KeyCode.E and not gameProcessed then
		label.Visible = false
		nextLabel.Visible = true
	end
end)
2 Likes

Oh, i did that. But i forgot to mention - i want to do it multiple times. One skip, text shows up, and another skip

1 Like

can i see ur script?
(Insert filler text here)

2 Likes

It just has the frame,text, player and character variables and typewrite function i made

1 Like

The script looks like this:

local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local Character = player.Character or player.CharacterAdded:Wait()

local MainText = script.Parent.MainText
local Intro = script.Parent.Parent

local function typeWrite(text)
	for i = 1, #text do
		MainText.Text = string.sub(text, i, 1)
		wait(0.05)
	end
end

1 Like

I suggest handle the typeWrite function by Coroutine.Wrap, in order to be able to stop it and skip it to the next dialogue as needed

2 Likes

Will do that in a second, i gotta deal with a virus

2 Likes

I just realised it isn’t what im talking about. Read now the Edited version of the post.

1 Like

I did it! I somehow managed to do it. If you want to know - first i made this:

local Skip1 = false
local Skip2 = false

And each skip is how many times i want to skip. I then made a InputBegan function and made this:

if Skip1 == true and Input.Keycode == Enum.Keycode.E then
--Do something
elseif Skip2 == true and Input.Keycode == Enum.Keycode.E then
--do something
end
end

And it worked :smiley: thanks for help everyone!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.