-
-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b93ec5d
commit 531fa31
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
client = nil | ||
service = nil | ||
|
||
return function(data) | ||
local gTable | ||
local answer | ||
|
||
local window = client.UI.Make("Window",{ | ||
Name = data.Name or "Prompt"; | ||
Title = data.Title or "Prompt"; | ||
Size = data.Size or {225,150}; | ||
SizeLocked = true; | ||
OnClose = function() | ||
if not answer then | ||
answer = "" | ||
end | ||
end | ||
}) | ||
|
||
local label = window:Add("TextLabel",{ | ||
Text = data.Question; | ||
Font = "SourceSans"; | ||
TextScaled = true; | ||
BackgroundTransparency = 1; | ||
TextWrapped = true; | ||
Size = UDim2.new(1, -10, 1, -35); | ||
}) | ||
|
||
local input = window:Add("TextBox", { | ||
Text = ""; | ||
TextSize = 18; | ||
PlaceholderText = data.PlaceholderText or ""; | ||
ClearTextOnFocus = data.ClearTextOnFocus or false; | ||
Size = UDim2.new(1, -40, 0, 25); | ||
Position = UDim2.new(0, 5, 1, -30); | ||
}) | ||
input.FocusLost:Connect(function(entered) | ||
if entered then | ||
answer = input.Text | ||
window:Close() | ||
end | ||
end) | ||
|
||
local submit = window:Add("TextButton", { | ||
Text = ">"; | ||
Font = "Arial"; | ||
TextSize = 22; | ||
Size = UDim2.new(0, 25, 0, 25); | ||
Position = UDim2.new(1, -30, 1, -30); | ||
OnClick = function() | ||
answer = input.Text | ||
window:Close() | ||
end; | ||
}) | ||
|
||
gTable = window.gTable | ||
window:Ready() | ||
repeat wait() until answer | ||
return answer | ||
end |