-
Notifications
You must be signed in to change notification settings - Fork 1
/
Main.lua
60 lines (52 loc) · 2.06 KB
/
Main.lua
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
-- Main [ Alexfeed1990 - 2022 ] --
-- Variables
local players = game.Players
local localPlayer = game.Players.localPlayer
local playerGui = localPlayer:WaitForChild("PlayerGui")
local mainGui = playerGui:WaitForChild("Roblo2DX")
local InsertService = game:GetService("InsertService")
-- Modules And Functions
local module = {}
function module.drawRectangle(posX, posY, sizeX, sizeY, backgroundCol, backgroundTransparency, borderColor, borderSize, name, parent)
if parent == "gui" then
local newFrame = Instance.new("Frame", parent)
newFrame.Name = name
newFrame.Position = UDim2.new(posX, 0, posY, 0)
newFrame.Size = UDim2.new(sizeX, 0, sizeY, 0)
newFrame.BackgroundColor3 = backgroundCol
newFrame.BorderColor3 = borderColor
newFrame.BackgroundTransparency = backgroundTransparency
newFrame.BorderSizePixel = borderSize
else
local newFrame = Instance.new("Frame", parent)
newFrame.Name = name
newFrame.Position = UDim2.new(posX, 0, posY, 0)
newFrame.Size = UDim2.new(sizeX, 0, sizeY, 0)
newFrame.BackgroundColor3 = backgroundCol
newFrame.BorderColor3 = borderColor
newFrame.BackgroundTransparency = backgroundTransparency
newFrame.BorderSizePixel = borderSize
end
end
function module.drawSprite(posX, posY, sizeX, sizeY, spriteId, spriteTransparency, borderColor, borderSize, name, parent)
if parent == "gui" then
local newImg = Instance.new("ImageLabel", mainGui)
newImg.Name = name
newImg.Image = "rbxthumb://type=Asset&id=".. spriteId.. "&w=420&h=420"
newImg.Position = UDim2.new(posX, 0, posY, 0)
newImg.Size = UDim2.new(sizeX, 0, sizeY, 0)
newImg.BorderColor3 = borderColor
newImg.ImageTransparency = spriteTransparency
newImg.BorderSizePixel = borderSize
else
local newImg = Instance.new("ImageLabel", mainGui)
newImg.Name = name
newImg.Image = "rbxthumb://type=Asset&id=".. spriteId.. "&w=420&h=420"
newImg.Position = UDim2.new(posX, 0, posY, 0)
newImg.Size = UDim2.new(sizeX, 0, sizeY, 0)
newImg.BorderColor3 = borderColor
newImg.ImageTransparency = spriteTransparency
newImg.BorderSizePixel = borderSize
end
end
return module