generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Fade

Previous Thread :: Next Thread 
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
02 Jan 2013 08:06 AM
If you don't understand the code; don't even bother trying to help.

13: unexpected symbol near ')'

local function GetAllObjects(Obj)

    Spawn(
        function()
        
            local Inc = ((1 - Obj.BackgroundTransparency) / 32) do
            
            for _ = 1, 32 do
                wait()
                Obj.BackgroundTransparency = (Obj.BackgroundTrasnparency + Inc)
            end
        end
    )
    
    for _, Sub in pairs(Obj:GetChildren()) do
        GetAllObjects(Sub)
    end
    
    wait(1)
end
Report Abuse
micolord is not online. micolord
Joined: 16 Mar 2009
Total Posts: 1242
02 Jan 2013 08:09 AM
Spawn(
function()

local Inc = ((1 - Obj.BackgroundTransparency) / 32) do

for _ = 1, 32 do
wait()
Obj.BackgroundTransparency = (Obj.BackgroundTrasnparency + Inc)
end
end)
Report Abuse
micolord is not online. micolord
Joined: 16 Mar 2009
Total Posts: 1242
02 Jan 2013 08:12 AM
If you wan't explanation, all I did was to put 'end' which was on line 12 to ')' which was on line 13.
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
02 Jan 2013 08:13 AM
I split it up; because its habit.

Spawn(function()
end)

is the same as

Spawn(
function()
end
)

Although I do

:connect(function()
end)

but that's not the point; it won't work.
Report Abuse
RoboTestGear is not online. RoboTestGear
Joined: 28 Dec 2009
Total Posts: 3063
02 Jan 2013 08:17 AM
I smell an over-complicated script
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
02 Jan 2013 08:29 AM
This isn't even that bad, and I have comments.

-- handles tab generation, and interface

-- change the look of the given tab
local function ChangeLook(Button, Label, Map, Size, Pos)

    -- generation
    if Map.Status ~= "Selected" then -- not selected
    
        Button.Size = UDim2.new(0, Size, 0, 18)
        Button.Position = UDim2.new(0, Pos, 0, 3)
        Button.ZIndex = 4
        
        if Map.Status == "Normal" and Map.Saved.Value then -- normal
        
            Button.BorderColor3 = _G.ReturnColor3(137, 140, 149)
            Label.BackgroundTransparency = 1
            
        else -- with overlay
        
            Label.BackgroundTransparency = 0.5
            
            if Map.Status == "Scroll" then -- scroll
            
                Button.BorderColor3 = _G.ReturnColor3(60, 127, 177)
                Label.BackgroundColor3 = _G.ReturnColor3(184, 216, 255)
                
            else -- not saved
            
                Button.BorderColor3 = _G.ReturnColor3(200, 0, 0)
                Label.BackgroundColor3 = Color3.new(1, 0, 0)
            end
        end
        
    else -- selected
    
        Button.Size = UDim2.new(0, (Size + 4), 0, 20)
        Button.Position = UDim2.new(0, (Pos - 2), 0, 1)
        Button.ZIndex = 5
        Button.BorderColor3 = Color3.new()
        Label.BackgroundColor3 = Color3.new(1, 1, 1)
        Label.BackgroundTransparency = 0
    end
end

-- global indexes
_G.Tabs = {

    ["Maps"] = {},
    
    -- sub functions
    ["Functions"] = {
        
        -- generate tabs sizes and positions
        Generate = function()
        
            local Pos = 15
            _G.Heading.Tabs:ClearAllChildren() -- remove old tabs
            
            -- creation
            for Num, Map in pairs(_G.Tabs.Maps) do
            
                local SubPos = Pos -- prevent overwritten variable
            
                -- make tab
                local Button = game.Workspace["Tab Button"]:Clone()
                Button.Name = Map.Name
                Button.Parent = _G.Heading.Tabs
                
                -- button reference
                Map["Button"] = Button
                
                -- change text
                local Label = Button.Label
                Label.Text = Map.Name
                
                local Size = math.floor(Label.TextBounds.X) + 20 -- regular size
                
                ChangeLook(Button, Label, Map, Size, SubPos)
                
                -- check for savee change
                Map.Saved.Changed:connect(function()
                    ChangeLook(Button, Label, Map, Size, SubPos)
                end)
                
                -- no highlight
                Button.MouseLeave:connect(function()
                    if Map.Status ~= "Selected" then
                        Map.Status = "Normal"
                        ChangeLook(Button, Label, Map, Size, SubPos)
                    end
                end)
                
                -- drag, highlight
                Button.MouseEnter:connect(function()
                    if _G.HeadingActive then
                    
                        local Generated = false
                        
                        -- tab drag
                        for SubNum, SubMap in pairs(_G.Tabs.Maps) do
                            if SubMap ~= Map and SubMap.Drag then
                                _G.Tabs.Maps[Num], _G.Tabs.Maps[SubNum] = _G.Tabs.Maps[SubNum], _G.Tabs.Maps[Num] -- inverse tab positions
                                _G.Tabs.Functions:Generate()
                                Generated = true
                            end
                        end
                        
                        -- scroll highlight
                        if not Generated and Map.Status ~= "Selected" then
                            Map.Status = "Scroll"
                            ChangeLook(Button, Label, Map, Size, SubPos)
                        end
                        
                    end
                end)
                
                Button.MouseButton1Down:connect(function()
                    --if _G.HeadingActive then
                    
                        if Map.Status ~= "Selected" then
                        
                            -- reset all buttons
                            for _, SubMap in pairs(_G.Tabs.Maps) do
                                SubMap.Status = "Normal"
                            end
                            
                            -- set current button
                            Map.Status = "Selected"
                            _G.Tabs.Functions:Generate()
                        end
                        
                        Map.Drag = true
                        --_G.TabSoak.Visible = true
                    --end
                end)
                
                Pos = Pos + Size + 1 -- move over, no double selections
            end
        end,
        
        -- instance for new/loaded maps
        Instance = function(self, MapName)
        
            -- reset tab status
            for _, Map in pairs(_G.Tabs.Maps) do
                Map.Status = "Normal"
            end
            
            -- create instance
            local SaveBool = Instance.new("BoolValue", script)
            SaveBool.Value = true
            
            table.insert(
            
                _G.Tabs.Maps,
                
                {
                    ["Name"] = MapName, -- map name
                    ["Index"] = "Insert Path Here", -- map instance
                    ["Saved"] = SaveBool, -- data bool
                    ["Status"] = "Selected", -- tab status
                    ["Drag"] = false, -- tab drag
                }
            )
            
            _G.Tabs.Functions:Generate() -- generate new tabs
        end
    }
}
Report Abuse
micolord is not online. micolord
Joined: 16 Mar 2009
Total Posts: 1242
02 Jan 2013 08:32 AM
There are some variables which I can't understand, probably this is not the whole script or just too advance for me. So yeah I give up. *fly away*
Report Abuse
micolord is not online. micolord
Joined: 16 Mar 2009
Total Posts: 1242
02 Jan 2013 08:34 AM
Well pretty late post I made.
Report Abuse
micolord is not online. micolord
Joined: 16 Mar 2009
Total Posts: 1242
02 Jan 2013 08:47 AM
Frankly I can't understand the script probably because I'm not at your level or your not being specific where the error in the new posted script is, so yeah I can't help, anyways good luck! *fly away*
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
02 Jan 2013 09:16 AM
Bump....
Report Abuse
Swordphin123 is not online. Swordphin123
Joined: 09 Apr 2008
Total Posts: 5234
02 Jan 2013 10:03 AM
I didn't really bother looking at the above posts other than the first you've posted, but maybe you haven't noticed or said in this thread but: Typos?

Obj.BackgroundTransparency = (Obj.BackgroundTra"sn"parency + Inc)
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
02 Jan 2013 03:31 PM
Thanks for finding that; but still not working.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image