Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I get a plugin script to detect when my mouse is hovering over one of the handles?

Asked by 10 years ago

So far I have been able to create the handle object itself when I click a part I want to (eventually) resize, as well as select the part (from a plugin). The handle object does not respond to any events I have thrown at it so far. The line that both doesn't work and doesn't break the script is:

h.MouseEnter:connect(function(axis) print(axis) end)

Any and all help is appreciated.

local mode=nil
local sel={}

local Gui=script.Gui
local toolbar=plugin:CreateToolbar("ZeroSpectrum")
local button1=toolbar:CreateButton("BuildZero","Toggle Build Menu","http://www.roblox.com/asset/?id=145723965")
button1.Click:connect(function()
    if not game:GetService("CoreGui"):FindFirstChild("Gui") then
        plugin:Activate(true)
        gui=Gui:Clone()
        gui.Parent=game:GetService("CoreGui")
        --box=gui.Box
        h=Instance.new("Handles",gui)
        h.MouseEnter:connect(function(axis) print(axis) end)
        local mouse = plugin:GetMouse()
        mouse.Button1Down:connect(function()
            target=mouse.Target
            if target then
                h.Adornee=target
                sel[1]=target
                game.Selection:Set(sel)
                h.Faces=target.ResizeableFaces
                --box.Adornee=target
            else
                h.Adornee=nil
                sel={}
                game.Selection:Set(sel)
                --box.Adornee=nil
            end
        end)
        resize=gui.Frame.Resize
        resize.MouseButton1Down:connect(function()
            print 'k'
            mode="resize"
        end)
    else
        plugin:Activate(false)
    end
end)
plugin.Deactivation:connect(function()
    if game:GetService("CoreGui"):FindFirstChild("Gui") then
        game:GetService("CoreGui"):FindFirstChild("Gui"):Destroy()
    end
end)

Answer this question