-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestUI
More file actions
62 lines (55 loc) · 1.99 KB
/
testUI
File metadata and controls
62 lines (55 loc) · 1.99 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
53
54
55
56
57
58
59
60
61
62
if game.CoreGui:FindFirstChild("BBB") then
game.CoreGui:FindFirstChild("BBB"):Destroy()
end
task.wait()
BBB = Instance.new("ScreenGui")
BBB.Name = "BBB"
BBB.Parent = game.CoreGui
hideUI = Instance.new("ImageButton")
hideUI.Name = "hideUI"
hideUI.Parent = game.CoreGui.BBB
hideUI.BackgroundColor3 = Color3.fromRGB(0, 255, 127)
hideUI.BackgroundTransparency = 1
hideUI.ClipsDescendants = true
hideUI.Position = UDim2.new(0.005, 1, 0.155, 1)
hideUI.Size = UDim2.new(0.078, 0, 0.136, 0)
hideUI.Image = "http://www.roblox.com/asset/?id=9434974330"
hideUI.MouseButton1Up:Connect(function()
game:GetService("VirtualInputManager"):SendKeyEvent(true,"F2",false,game.Players.LocalPlayer.Character.HumanoidRootPart)
wait(0.1)
game:GetService("VirtualInputManager"):SendKeyEvent(false,"F2",false,game.Players.LocalPlayer.Character.HumanoidRootPart)
end)
hideUICorner = Instance.new("UICorner")
hideUICorner.Parent = game.CoreGui.BBB.hideUI
hideUICorner.CornerRadius = UDim.new(1,0)
UIS = game:GetService('UserInputService')
frame = game.CoreGui.BBB.hideUI
dragToggle = nil
dragSpeed = 0.05
dragStart = nil
startPos = nil
function updateInput(input)
delta = input.Position - dragStart
position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X,
startPos.Y.Scale, startPos.Y.Offset + delta.Y)
game:GetService('TweenService'):Create(frame, TweenInfo.new(dragSpeed), {Position = position}):Play()
end
frame.InputBegan:Connect(function(input)
if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
dragToggle = true
dragStart = input.Position
startPos = frame.Position
input.Changed:Connect(function()
if input.UserInputState == Enum.UserInputState.End then
dragToggle = false
end
end)
end
end)
UIS.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
if dragToggle then
updateInput(input)
end
end
end)