You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want to make a plugin that allows me to import mesh into RobloxStudio -
What is the issue? Include screenshots / videos if possible!
The problem is that when I press my button it does not work. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked up my other plugin and it doesn’t look any different than my current plugin, so I don’t understand anything. I have googled this thing, but I did not find anything.
So, please, just why? I have been programming on Roblox for years now (2 years, not that long, but still, I know the simplest things) and I have never seen anything like it. Recently I started programming plugins, and now I’m stuck here. I already have practically everything I need, and the only thing that blocks me is this little thing. I find it embarrassing and really annoying, if someone finds out why/where this problem happens, it would be really helpful. And no, this is not the first time I work with GUIs. I have created over hundreds of GUIs in total, so why?
Here you can find the MainScript source code:
local ButtonManager = require(script.MainBackground.Scripts.ButtonManager)
local toolbar:PluginToolbar
local toolbarCombiner = game:GetService("CoreGui"):FindFirstChild("FrostDracony's Suite")
local Enabled:boolean = false
if toolbarCombiner then
toolbar = toolbarCombiner.Value
if toolbar == nil then
toolbar = plugin:CreateToolbar("FrostDracony's Suite")
toolbarCombiner.Value = toolbar
end
else
toolbar = plugin:CreateToolbar("FrostDracony's Suite")
toolbarCombiner = Instance.new("ObjectValue")
toolbarCombiner.Value = toolbar
toolbarCombiner.Name = "FrostDracony's Suite"
toolbarCombiner.Parent = game:GetService("CoreGui")
end
local Button = toolbar:CreateButton("FrostDracony's MeshEditor",
"Powerfull Tools for working with Meshs",
"rbxassetid://1507949215")
--Just, just dont see above. This is used for saving the toolbar accross different plugins
--Basic Plugin, i dont need to explain it at all
local widgetInfo = DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Right,
false,
true,
700,
300,
300,
150
)
local PluginWidget = plugin:CreateDockWidgetPluginGui("MeshEditor", widgetInfo)
PluginWidget.Name = "FrostDracony's MeshEditor"
PluginWidget.Title = "MeshEditor"
PluginWidget.Enabled = false
local Background:Frame = script.MainBackground
ButtonManager:Init()
local function OnButtonClicked()
Enabled = not Enabled
PluginWidget.Enabled = Enabled
Button:SetActive(Enabled)
if Enabled then
Background:Clone().Parent = PluginWidget
else
PluginWidget.MainBackground:Destroy()
end
end
Button.Click:Connect(OnButtonClicked)
And here is the ButtonManagerScript source-code:
local module = {}
local StudioService = game:GetService("StudioService")
local OBJLoader = require(script.Parent.OBJ_Loader.OBJLoader)
local AddButton = script.Parent.Parent.OtherBackground.AddButton
function module:Init()
print("INIT")
AddButton.MouseButton1Click:Connect(function()
print("CLICK")
local File:File|nil = StudioService:PromptImportFiles({"obj"})
if File then
OBJLoader.loadOBJ(File)
else
warn("FrostDracony's MeshEditor: File importing was cancelled, retry.")
end
end)
end
return module
That’s all I show. I think this is all I could do. If someone found out the problem, this would be really helpful. Thanks for reading:
~~Eterna