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

How to space out my tabs? [closed]

Asked by
jqrx 0
9 years ago
Edited 4 years ago

Another long script. I want to make my tabs spaced out instead of overlapping. Please help!

rot = 2 + 8;
i = 5;
tabs = {};
function output(plr,text,func)
        if not type(func) == "function" or func == nil then return end
        if game.Players:FindFirstChild(plr) then
                plr = game.Players:FindFirstChild(plr);
        else
                print("Player does not exist")
        end
        local b = Instance.new("Part",workspace);
        local char = plr.Character
        b.CFrame = CFrame.new(math.random(1,20),0,0)
        b.BrickColor = BrickColor.White();
        b.Anchored = true;
        b.Material = Enum.Material.Neon;
        local light = Instance.new("PointLight",b);
        b.CanCollide = false;
        b.CFrame = CFrame.new(math.random(0,100),0,0);
        b.Size = Vector3.new(2,2,.1);
        local gui = Instance.new("SurfaceGui",b);
        gui.Adornee = b;
        gui.Face = "Front";
        local frame = Instance.new("Frame",gui);
        frame.Size = UDim2.new(0,1,0,1);
        frame.BackgroundColor3 = BrickColor.Random().Color;
        local textbox = Instance.new("TextBox",frame);
        textbox.BackgroundColor3 = BrickColor.Random().Color;
        textbox.Position = UDim2.new(0,150,0,80);
        textbox.Size = UDim2.new(0,500,0,100);
        textbox.Text = text;
        textbox.Font = "SourceSansBold";
        textbox.TextScaled = true;
        local click = Instance.new("ClickDetector",b);
        click.MouseClick:connect(function(player)
                if player.Name == plr.Name then
                        func()
                else
                        return
                end
        end)
        click.MouseHoverEnter:connect(function(plr)
                -- b.Size = Vector3.new(4,4,.1);
                b.Size = b.Size + Vector3.new(1.5,1.5,.1);
        end)
        click.MouseHoverLeave:connect(function(plr)
                b.Size = b.Size - Vector3.new(1.5,1.5,.1);
        end)
        plr.Chatted:connect(function(msg)
                if msg == "dismiss" then
                        b:Destroy();
                        for i,v in pairs(tabs) do
                                table.remove(tabs,i);
                        end
                end
        end)
        table.insert(tabs,b)
        game:service("RunService").Stepped:connect(function()
                if b.Parent == nil then
                        return;
                else
                        while true do
                        wait(0.05)
                        b.CFrame = char.Torso.CFrame * CFrame.Angles(0, math.rad(rot), 0) * CFrame.new(4,0,4)
                        rot = rot + 0.01
end
                end
        end)
end
output("","Text",function()
    return
end)
0
What do you mean by 'spaced out'? I'm pretty sure this question is purely about formatting, which is definitely not a good fit for SH. adark 5487 — 9y

Closed as off-topic by adark

This question has been closed by our community as being off-topic from ROBLOX Lua Scripting.

Why was this question closed?