1 | local plrs = game:service('Players') |
2 | local plr = plrs.LocalPlayer |
3 | local UIS = game:service('UserInputService') |
4 | local RS = game:service('RunService') |
5 | |
6 | local PlrGui = plr:WaitForChild('PlayerGui') |
7 | |
8 | -- Objects |
9 | |
10 | local ACHolder = Instance.new("ScreenGui") |
11 | local BG = Instance.new("Frame") |
12 | local Main = Instance.new("Frame") |
13 | local ACLabel = Instance.new("TextLabel") |
14 | local ACKeySet = Instance.new("TextButton") |
15 | |
16 | -- Properties |
17 | |
18 | ACHolder.Name = "ACHolder" |
19 | ACHolder.Parent = PlrGui |
20 | |
21 | BG.Name = "BG" |
22 | BG.Parent = ACHolder |
23 | BG.Active = true |
24 | BG.AnchorPoint = Vector2.new(0.5, 0.5) |
25 | BG.BackgroundColor3 = Color3.new(1, 1, 1) |
26 | BG.Position = UDim2.new(0.5, 0, 0.5, 0) |
27 | BG.Size = UDim2.new(0, 200, 0, 125) |
28 | BG.Style = Enum.FrameStyle.DropShadow |
29 | BG.Draggable = true |
30 | |
31 | Main.Name = "Main" |
32 | Main.Parent = BG |
33 | Main.Active = true |
34 | Main.AnchorPoint = Vector2.new(0.5, 0.5) |
35 | Main.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255) |
36 | Main.BackgroundTransparency = 0.5 |
37 | Main.Position = UDim2.new(0.5, 0, 0.5, 0) |
38 | Main.Size = UDim2.new(0, 185, 0, 110) |
39 | Main.ZIndex = 2 |
40 | |
41 | ACLabel.Name = "ACLabel" |
42 | ACLabel.Parent = Main |
43 | ACLabel.AnchorPoint = Vector2.new(0.5, 0.5) |
44 | ACLabel.BackgroundColor3 = Color3.new(1, 1, 1) |
45 | ACLabel.BackgroundTransparency = 1 |
46 | ACLabel.Position = UDim2.new(0.5, 0, 0.300000012, 0) |
47 | ACLabel.Size = UDim2.new(0, 120, 0, 25) |
48 | ACLabel.Font = Enum.Font.Arcade |
49 | ACLabel.Text = "AC" |
50 | ACLabel.TextColor3 = Color3.new(1, 1, 1) |
51 | ACLabel.TextSize = 60 |
52 | ACLabel.ZIndex = 2 |
53 | |
54 | ACKeySet.Name = "ACKeySet" |
55 | ACKeySet.Active = true |
56 | ACKeySet.Parent = Main |
57 | ACKeySet.AnchorPoint = Vector2.new(0.5, 0.5) |
58 | ACKeySet.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255) |
59 | ACKeySet.BackgroundTransparency = 1 |
60 | ACKeySet.Position = UDim2.new(0.5, 0, 0.699999988, 0) |
61 | ACKeySet.Size = UDim2.new(0, 100, 0, 30) |
62 | ACKeySet.Font = Enum.Font.Code |
63 | ACKeySet.Text = "Set Keybind" |
64 | ACKeySet.TextColor3 = Color3.new(1, 1, 1) |
65 | ACKeySet.TextSize = 15 |
66 | ACKeySet.ZIndex = 3 |
67 | |
68 | --Do stuff. |
69 | local inFrame = false |
70 | |
71 | BG.MouseEnter:connect(function() |
72 | inFrame = true |
73 | end) |
74 | |
75 | BG.MouseLeave:connect(function() |
76 | inFrame = false |
77 | end) |
78 | |
79 | local PlaceHolder = function() |
80 | print('lel') |
81 | end |
82 | |
83 | local keybind = Enum.KeyCode.RightControl |
84 | local KeyPressEquiv = mouse1click or leftclick or MOUSE_CLICK or PlaceHolder |
85 | |
86 | if Synapse then KeyPressEquiv = Synapse.mouse1click end |
87 | if Input then KeyPressEquiv = Input.LeftClick end |
88 | |
89 | local con = nil |
90 | local ucon = nil |
91 | local mcon = nil |
92 | |
93 | ACKeySet.MouseEnter:connect(function() |
94 | ACKeySet.BackgroundTransparency = 0.5 |
95 | end) |
96 | |
97 | ACKeySet.MouseLeave:connect(function() |
98 | ACKeySet.BackgroundTransparency = 1 |
99 | end) |
100 | |
101 | local function ReInit() |
102 | ucon = UIS.InputBegan:connect(function(keyy) |
103 | if keyy == keybind and KeyPressEquiv ~= nil then |
104 | if mcon then mcon:disconnect() mcon = nil else |
105 | mcon = RS.Stepped:connect(function() |
106 | if not inFrame then |
107 | KeyPressEquiv() |
108 | end |
109 | end) |
110 | end |
111 | end |
112 | end) |
113 | end |
114 | |
115 | ACKeySet.MouseButton1Down:connect(function() |
116 | ACKeySet.Text = 'Press a key now.' |
117 | if ucon then ucon:disconnect() end |
118 | wait() |
119 | |
120 | con = UIS.InputBegan:connect(function(keyy) |
121 | |
122 | if keyy.UserInputType == Enum.UserInputType.Keyboard then |
123 | keybind = keyy |
124 | ACKeySet.Text = keyy.KeyCode.Name |
125 | con:disconnect() |
126 | ReInit() |
127 | end |
128 | end) |
129 | end) |