-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustomInstance.lua
More file actions
37 lines (32 loc) · 992 Bytes
/
customInstance.lua
File metadata and controls
37 lines (32 loc) · 992 Bytes
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
local originalNew = Instance.new
local classMap = {
Window = "ScreenGui",
Tab = "Frame",
Button = "TextButton",
Inputbox = "TextBox",
Toggle = "TextButton",
Slider = "Frame",
Checkbox = "TextButton"
}
Instance.new = function(className, parent)
local realClass = classMap[className] or className
local obj = originalNew(realClass)
-- Style customization
if className == "Window" then
obj.Name = "CustomUR_Window"
obj.ResetOnSpawn = false
elseif className == "Tab" then
obj.Size = UDim2.new(0, 400, 0, 300)
obj.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
elseif className == "Button" then
obj.Size = UDim2.new(0, 120, 0, 30)
obj.BackgroundColor3 = Color3.fromRGB(60, 60, 60)
elseif className == "Inputbox" then
obj.Size = UDim2.new(0, 200, 0, 30)
obj.PlaceholderText = "Enter text..."
end
if parent then
obj.Parent = parent
end
return obj
end