-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCore.lua
More file actions
69 lines (57 loc) · 1.5 KB
/
Core.lua
File metadata and controls
69 lines (57 loc) · 1.5 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
local UIController = require(script.Parent.Modules.UIController)
local CustomCamera = require(script.Parent.Modules.CustomCamera)
local toolbar = plugin:CreateToolbar("EasyCamera")
local cameraCreate = toolbar:CreateButton(
"Create new camera",
"Creates a custom desk camera that copies the camera position and orientation in the Roblox Studio editor",
"rbxassetid://6125281125"
)
local function radiansToDegrees(vector: Vector3): Vector3
return Vector3.new(
math.deg(vector.X),
math.deg(vector.Y),
math.deg(vector.Z)
)
end
if not workspace:FindFirstChild('CustomCameras') then
local cameraDir = Instance.new('Folder')
cameraDir.Name = 'CustomCameras'
cameraDir.Parent = workspace
end
local info = DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Left,
false,
false,
200,
300,
150,
150
)
local widget = plugin:CreateDockWidgetPluginGui(
"EasyCamera",
info
)
widget.Title = 'EasyCamera | Create'
local CreateUI = script.Parent.UI.Background
CreateUI.Parent = widget
cameraCreate.Click:Connect(function()
widget.Enabled = not widget.Enabled
print(CreateUI.Parent)
end)
local CreateCamera = CreateUI.InteractionBox.CreateButton
local NameInput = CreateUI.InteractionBox.NameInput.TextBox
CreateCamera.Activated:Connect(function()
if NameInput.Text == '' then
UIController.showAlert(
"Please enter name of camera",
UIController.AlertLabelTypes.ERROR
)
return
end
local name = NameInput.Text
local camera = CustomCamera.new(
workspace.Camera,
name
)
NameInput.Text = ''
end)