-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDestroyGUI.txt
More file actions
80 lines (65 loc) · 2.19 KB
/
DestroyGUI.txt
File metadata and controls
80 lines (65 loc) · 2.19 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
local equipped = false
local Mouse = game.Players.LocalPlayer:GetMouse()
local box = Instance.new("SelectionBox", game.StarterGui)
box.Adornee = nil
box.Color3 = Color3.fromRGB(255, 255, 255)
box.SurfaceColor3 = Color3.fromRGB(255, 255, 255)
box.LineThickness = 0.1
-- Instances:
local DestroyUI = Instance.new("ScreenGui")
local Main = Instance.new("TextButton")
local Check = Instance.new("BoolValue")
local UITextSizeConstraint = Instance.new("UITextSizeConstraint")
local UIAspectRatioConstraint = Instance.new("UIAspectRatioConstraint")
--Properties:
DestroyUI.Name = "DestroyUI"
DestroyUI.Parent = game.CoreGui
Main.Name = "Main"
Main.Parent = DestroyUI
Main.AnchorPoint = Vector2.new(1, 0)
Main.BackgroundColor3 = Color3.fromRGB(255,255,255)
Main.BorderSizePixel = 0
Main.Position = UDim2.new(1, 0, 0, 0)
Main.Size = UDim2.new(0.150000006, 0, 0.0500000007, 0)
Main.AutoButtonColor = false
Main.Font = Enum.Font.SourceSansLight
Main.Text = "Destroy"
Main.TextColor3 = Color3.fromRGB(255, 0, 0)
Main.TextScaled = true
Main.TextSize = 14
Main.TextWrapped = true
Check.Parent = DestroyUI
Check.Value = false
UITextSizeConstraint.Parent = Main
UITextSizeConstraint.MaxTextSize = 40
UIAspectRatioConstraint.Parent = Main
UIAspectRatioConstraint.AspectRatio = 3.9268293380737
-- Scripts
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
local tweenToGreen = {TextColor3 = Color3.fromRGB(0, 255, 127)}
local tweenToRed = {TextColor3 = Color3.fromRGB(255, 0, 0)}
local AnimationGreen = game:GetService("TweenService"):Create(Main, tweenInfo, tweenToGreen)
local AnimationRed = game:GetService("TweenService"):Create(Main, tweenInfo, tweenToRed)
Main.MouseButton1Down:Connect(function()
if Check.Value == false then
Check.Value = true
AnimationGreen:Play()
equipped = true
box.Parent = game.Workspace
while equipped == true do
wait(0.1)
box.Adornee = Mouse.Target
end
else
Check.Value = false
AnimationRed:Play()
equipped = false
box.Adornee = nil
box.Parent = game.StarterGui
end
end)
Mouse.Button1Down:Connect(function()
if equipped == true then
Mouse.Target:Destroy()
end
end)