-
-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathBubbleChat.luau
More file actions
52 lines (45 loc) · 1.64 KB
/
BubbleChat.luau
File metadata and controls
52 lines (45 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
client, service = nil, nil
return function(data, env)
if env then
setfenv(1, env)
end
local gTable
local color = data.Color
if color == "off" then
client.UI.Remove("BubbleChat")
else
local window = client.UI.Make("Window",{
Name = "BubbleChat";
Title = "Bubble Chat";
Icon = client.MatIcons.Chat;
Size = {260,57};
Position = UDim2.new(0, 10, 1, -80);
AllowMultiple = false;
})
if window then
local box = window:Add("TextBox",{
Text = `Click here or press "{client.Functions.KeyCodeToName(Enum.KeyCode.Semicolon.Value)}" to chat`;
PlaceholderText = `Click here or press "{client.Functions.KeyCodeToName(Enum.KeyCode.Semicolon.Value)}" to chat`;
BackgroundTransparency = 1;
TextScaled = true;
TextSize = 20;
})
box.FocusLost:Connect(function(enterPressed)
if enterPressed and service.Player.Character:FindFirstChild('Head') and color and box.Text~=`Click here or press "{client.Functions.KeyCodeToName(Enum.KeyCode.Semicolon.Value)}" to chat` then
if #box.Text > 0 then
service.ChatService:Chat(service.Player.Character.Head, service.LaxFilter(box.Text), color)
end
box.Text = `Click here or press "{client.Functions.KeyCodeToName(Enum.KeyCode.Semicolon.Value)}" to chat`
end
end)
window:BindEvent(service.UserInputService.InputBegan, function(inputObject, gameProcessed)
if not gameProcessed and inputObject.UserInputType == Enum.UserInputType.Keyboard and inputObject.KeyCode == Enum.KeyCode.Semicolon then
service.RunService.RenderStepped:Wait()
box:CaptureFocus()
end
end)
gTable = window.gTable
window:Ready()
end
end
end