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

I've got a tool that doesn't work, can anyone help? (Tool mechanism in description)

Asked by 5 years ago

Hello, I've ran into a problem when using a tool called 'LabelTool'.

The Label Tool is a flying text tool generator, which places BillboardGui Text Labels on parts, which can appear colourful, the tool is usually used in role playing games, like colony building games. The options of the colors, (textColor and outlineColor) can be changed by navigating to the left side and clicking a blank button, and clicking on a color, it will also preview how it will look if you change the colors, you may also change the text aswell. When done with all those, you can click on a part to snap the text ontop of it.

The tool itself is a HopperBin Class tool, before the 'FilteringUpdate' the tool worked properly, I've seen something on other questions about HopperBin is deprecated.

Look at the tool's instances here. Look at the tool's properties here.

OutlineColorPicker and TextColorPicker contains a bunch of colors, a button decal and a script. The scripts are all down below if you want to read them. I don't mind copying this as it's free-to-use.

Local Script contains:

wait()
active = false
local m1
local m2
local label = script.Parent.TextGUI
local toolGui = script.Parent.LabelTool
local play = script.Parent.Parent.Parent
local box

function click(targ)
    if targ ~= nil then
    if targ.Locked == false then
        if not targ:FindFirstChild("TextGUI") then
            local gui = label:Clone()
            gui.label.Text = script.Parent.title.Value
            gui.label.TextColor3 = script.Parent.tc.Value
            gui.label.TextStrokeColor3 = script.Parent.oc.Value
            gui.Parent = targ
        else
            local gui = targ:FindFirstChild("TextGUI")
            gui.label.Text = script.Parent.title.Value
            gui.label.TextColor3 = script.Parent.tc.Value
            gui.label.TextStrokeColor3 = script.Parent.oc.Value
        end
    end
    end
end

function hover(targ)
    if not box then
        box = Instance.new("SelectionBox")
        box.Color = BrickColor.new("Deep blue")
        box.Transparency = 0.5
        box.Parent = script.Parent
    end
    if targ ~= nil then
    if targ.Locked == false then
        box.Adornee = targ
        box.Parent = game.Workspace
    else
        box.Adornee = nil
        box.Parent = script.Parent
    end
    end
end

script.Parent.Selected:connect(function(m)
    active = true
    toolGui.Parent = play.PlayerGui
    m1 = play:GetMouse().Button1Down:connect(function() click(play:GetMouse().Target) end)
    m2 = play:GetMouse().Move:connect(function() hover(play:GetMouse().Target) end)
end)

script.Parent.Deselected:connect(function()
    active = true
    toolGui.Parent = script.Parent
    m1:disconnect()
    m2:disconnect()
end)

OutlineLabel textLabel contains this script:

local r = script.Parent.Parent.tc
local g = script.Parent.Parent.oc
local bin = script.Parent.Parent.bin.Value

function change()
    script.Parent.TextStrokeColor3 = g.Value
    bin.oc.Value = g.Value
end

g.Changed:connect(change)

function change2()
    script.Parent.TextColor3 = r.Value
    script.Parent.Parent.colorLabel.TextColor3 = r.Value
    bin.tc.Value = r.Value
end

r.Changed:connect(change2)

script.Parent.Parent.textBox.Changed:connect(function() 
    bin.txt.Value = script.Parent.Parent.textBox.Text
end)

TextColorPicker has a script containing:

local m1
local m2
function AddButton(button)
    button.MouseButton1Down:connect(function()
    script.Parent.Parent.tc.Value = button.BackgroundColor3
    end)
end

open = false
active = false
b = 10 --Speed the window opens/closes (Must be a positive number) 
script.Parent.Button.MouseButton1Down:connect(function()
if not active then active = true
    if open then
    open = false
        for i = 176,16,-b do
        script.Parent.Size = UDim2.new(0,96,0,i)
        wait()
        end
    else
    open = true
        for i = 20,180,b do
        script.Parent.Size = UDim2.new(0,160,0,i)
        wait()
        end
    end
active = false
end
end)

local buttons = script.Parent:GetChildren()
for i = 1,#buttons do
    if buttons[i].ClassName == "TextButton" then
    AddButton(buttons[i])
    end
end

OutlineColorPicker has a script, of almost the exact same above.

function AddButton(button)
    button.MouseButton1Down:connect(function()
    script.Parent.Parent.oc.Value = button.BackgroundColor3
    end)
end

open = false
active = false
b = 10 --Speed the window opens/closes (Must be a positive number) 
script.Parent.Button.MouseButton1Down:connect(function()
if not active then active = true
    if open then
    open = false
        for i = 176,16,-b do
        script.Parent.Size = UDim2.new(0,96,0,i)
        wait()
        end
    else
    open = true
        for i = 20,180,b do
        script.Parent.Size = UDim2.new(0,160,0,i)
        wait()
        end
    end
active = false
end
end)

local buttons = script.Parent:GetChildren()
for i = 1,#buttons do
    if buttons[i].ClassName == "TextButton" then
    AddButton(buttons[i])
    end
end
3
You're using HopperBins, a deprecated item. Use Tools instead. User#19524 175 — 5y
0
Did that one, but what happened is the tool didn't work and when i equip it only the text appears in middle of the map, and the mechanism of the tool doesn't even work. AstronaoutYT 0 — 5y

Answer this question