@adiholick/nvstudio-mcp 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,52 @@
1
+ return function(targetInstance, data, ctx, targetPath)
2
+ local CollectionService = game:GetService("CollectionService")
3
+
4
+ local props = {
5
+ Name = targetInstance.Name,
6
+ ClassName = targetInstance.ClassName,
7
+ Parent = targetInstance.Parent and targetInstance.Parent.Name or "nil",
8
+ }
9
+
10
+ -- Ambil Properties Umum secara aman via pcall
11
+ local function tryProp(propName)
12
+ local success, val = pcall(function() return targetInstance[propName] end)
13
+ if success and val ~= nil then
14
+ if typeof(val) == "Vector3" then
15
+ props[propName] = {math.round(val.X*100)/100, math.round(val.Y*100)/100, math.round(val.Z*100)/100}
16
+ elseif typeof(val) == "Color3" then
17
+ props[propName] = {math.round(val.R * 255), math.round(val.G * 255), math.round(val.B * 255)}
18
+ elseif typeof(val) == "CFrame" then
19
+ props[propName] = tostring(val)
20
+ elseif typeof(val) == "EnumItem" then
21
+ props[propName] = val.Name
22
+ elseif typeof(val) == "UDim2" then
23
+ props[propName] = {val.X.Scale, val.X.Offset, val.Y.Scale, val.Y.Offset}
24
+ elseif typeof(val) == "Instance" then
25
+ props[propName] = val:GetFullName()
26
+ else
27
+ props[propName] = val
28
+ end
29
+ end
30
+ end
31
+
32
+ local commonProps = {
33
+ "Anchored", "CanCollide", "Transparency", "Reflectance",
34
+ "Position", "Size", "Color", "Material", "Text", "TextColor3",
35
+ "BackgroundTransparency", "BackgroundColor3", "Visible", "Enabled",
36
+ "Volume", "Playing", "Looped", "Value"
37
+ }
38
+
39
+ for _, prop in ipairs(commonProps) do
40
+ tryProp(prop)
41
+ end
42
+
43
+ -- Attributes & Tags
44
+ pcall(function()
45
+ props.Attributes = targetInstance:GetAttributes()
46
+ end)
47
+ pcall(function()
48
+ props.Tags = CollectionService:GetTags(targetInstance)
49
+ end)
50
+
51
+ return { status = "success", result = props }
52
+ end
@@ -0,0 +1,7 @@
1
+ return function(targetInstance, data, ctx, targetPath)
2
+ if targetInstance:IsA("LuaSourceContainer") then
3
+ return { status = "success", result = targetInstance.Source }
4
+ else
5
+ return { status = "error", error = "Target BUKAN Script (ClassName: " .. targetInstance.ClassName .. "). Kamu WAJIB menggunakan get_children terlebih dahulu sebelum menarik source." }
6
+ end
7
+ end
@@ -0,0 +1,18 @@
1
+ return function(targetInstance, data, ctx, targetPath)
2
+ local InsertService = game:GetService("InsertService")
3
+ local assetId = tonumber(data)
4
+ if not assetId then
5
+ return { status = "error", error = "Asset ID harus berupa angka yang valid." }
6
+ end
7
+
8
+ local success, model = pcall(function()
9
+ return InsertService:LoadAsset(assetId)
10
+ end)
11
+
12
+ if success and model then
13
+ model.Parent = game.Workspace
14
+ return { status = "success", result = "Aset berhasil dimasukkan ke Workspace." }
15
+ else
16
+ return { status = "error", error = "Gagal memuat aset. Pastikan Asset ID benar dan akun/plugin Anda memiliki izin (Ownership/Public)." }
17
+ end
18
+ end