I’m trying to pause my UserInputService until the event is triggered.
Here’s my script.
local UIS = game:GetService("UserInputService")
local storyChat = {"I need to you solve a couple of cases for me. Some are pretty hard.", "Our first task is getting this door open. There's a keypad over there. Must be a pin of some type.", "I was left with a hint: The fool doth think he is wise, but the wise man knows himself to be a fool.","Congrats, you opened the door."}
local dialog = 1
local event1 = game.ReplicatedStorage:WaitForChild("Correct1")
UIS.InputEnded:Connect(function(input,gpe)
if gpe then
return
end
if input.KeyCode == Enum.KeyCode.Return then
local input = input.KeyCode == Enum.KeyCode.Return
if input then
script.Parent.Text = storyChat[dialog + 1]dialog += 1
print(dialog)
if dialog == 3 then
local frame = script.Parent.Parent
script.Parent.Parent.Size = UDim2.new(0.222, 0,0.31, 0)
frame:TweenPosition(
UDim2.new(0, 0,0.435, 0),
"Out",
"Quad",
5,
true
)
event1.OnClientEvent:Wait()
end
end
end
end)
local UIS = game:GetService("UserInputService")
local d = false
local storyChat = {"I need to you solve a couple of cases for me. Some are pretty hard.", "Our first task is getting this door open. There's a keypad over there. Must be a pin of some type.", "I was left with a hint: The fool doth think he is wise, but the wise man knows himself to be a fool.","Congrats, you opened the door."}
local dialog = 1
local event1 = game.ReplicatedStorage:WaitForChild("Correct1")
UIS.InputEnded:Connect(function(input,gpe)
if gpe then
return
end
if input.KeyCode == Enum.KeyCode.Return then
local input = input.KeyCode == Enum.KeyCode.Return
if input and not d then
d = true
script.Parent.Text = storyChat[dialog + 1]dialog += 1
print(dialog)
if dialog == 3 then
local frame = script.Parent.Parent
script.Parent.Parent.Size = UDim2.new(0.222, 0,0.31, 0)
frame:TweenPosition(
UDim2.new(0, 0,0.435, 0),
"Out",
"Quad",
5,
true
)
event1.OnClientEvent:Wait()
end
d = false
end
end
end)
local UIS = game:GetService("UserInputService")
local d = false
local storyChat = {"I need to you solve a couple of cases for me. Some are pretty hard.", "Our first task is getting this door open. There's a keypad over there. Must be a pin of some type.", "I was left with a hint: The fool doth think he is wise, but the wise man knows himself to be a fool.","Congrats, you opened the door."}
local dialog = 1
local event1 = game.ReplicatedStorage:WaitForChild("Correct1")
UIS.InputEnded:Connect(function(input,gpe)
if gpe then
return
end
if input.KeyCode == Enum.KeyCode.Return and not d then
d = true
script.Parent.Text = storyChat[dialog + 1]dialog += 1
print(dialog)
if dialog == 3 then
local frame = script.Parent.Parent
script.Parent.Parent.Size = UDim2.new(0.222, 0,0.31, 0)
frame:TweenPosition(
UDim2.new(0, 0,0.435, 0),
"Out",
"Quad",
5,
true
)
event1.OnClientEvent:Wait()
end
d = false
end
end)