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
 

Re: I don't get it

Previous Thread :: Next Thread 
Emphazed is not online. Emphazed
Joined: 20 Dec 2009
Total Posts: 593
23 Mar 2014 04:44 PM
It only works in a solo test server...

local songs = {}
local selected = {button=nil;song=nil}
local playing = {button=nil;song=nil}
local playB = script.Parent.Play
local volume = script.Parent.Volume

local player = script.Parent.Parent.Parent.Parent

local credit = Instance.new("TextLabel")

function setCredit()
credit.Name = "Welcome"
credit.Font = "ArialBold"
credit.FontSize = "Size11"
credit.Position = UDim2.new(0.5,0,0,20)
credit.Size = UDim2.new(0,0,0,0)
credit.Text = "Club Stratos"
credit.TextColor3 = Color3.new(1,1,1)
credit.TextTransparency = 0
credit.BackgroundTransparency = 1
credit.ZIndex = (script.Parent.ZIndex+1)
credit.archivable = true
credit.Visible = true
credit.Parent = script.Parent
end

setCredit()
credit.Changed:connect(setCredit)

function getSongs()
for _,v in pairs(script.Parent.Songs:GetChildren()) do
table.insert(songs,{button=v;song=v.Song})
end
end

function setup()
for _,data0 in pairs(songs) do
data0.button.MouseButton1Click:connect(function()
for _,data1 in pairs(songs) do
data1.button.Style = 2
end
if (selected.button == data0.button) then
selected.button,selected.song = nil,nil
playB.Active = false
playB.Text = ""
else
selected.button,selected.song = data0.button,data0.song
playB.Active = true
playB.Text = (playing.button == data0.button and "STOP" or "PLAY")
data0.button.Style = 1
end
end)
end
local function red(b)
delay(0,function()
for i = 1,0,-0.1 do
b.TextColor3 = Color3.new((0.6+(i*0.4)),i,i)
wait()
end
b.TextColor3 = Color3.new(0.6,0,0)
end)
end
local function white(b)
delay(0,function()
for i = 0,1,0.1 do
b.TextColor3 = Color3.new((0.6+(i*0.4)),i,i)
wait()
end
b.TextColor3 = Color3.new(1,1,1)
end)
end
playB.MouseButton1Click:connect(function()
if (not playB.Active) then return end
if (selected.button ~= playing.button) then
if (playing.song) then playing.song:stop() end
if (playing.button) then white(playing.button) end
playing.button,playing.song = nil,nil
end
if (playing.button) then
playing.song:stop()
white(playing.button)
playing.button,playing.song = nil,nil
playB.Text = "PLAY"
elseif (selected.button) then
playing.button,playing.song = selected.button,selected.song
playing.song:play()
red(playing.button)
playB.Text = "STOP"
end
end)
volume.Vol.Changed:connect(function()
for _,data in pairs(songs) do
data.song.Volume = volume.Vol.Value
end
end)
local drag = false
local function setCur(x)
if (not drag) then return end
local Start = volume.AbsolutePosition.x
local End = (volume.AbsolutePosition.x+volume.AbsoluteSize.x)
local full = (End-Start)
local cur = (x-Start)
local ratio = (cur/full)
ratio = (ratio < 0.05 and 0 or ratio > 0.95 and 1 or ratio)
volume.Current.Position = UDim2.new(ratio,-3,0,-15)
volume.Vol.Value = ratio
end
local cur = 1
local col = script.Parent.Collapse
col.MouseButton1Click:connect(function()
if (cur == 0) then return
elseif (cur == 1) then
cur = 0
delay(0,function()
for i = 0,46,4 do
col.Position = UDim2.new(1,i,0,-6)
col.TextTransparency = (i/46)
wait()
end
col.Position = UDim2.new(1,46,0,-6)
col.TextTransparency = 1
end)
for i = 10,-script.Parent.AbsoluteSize.x,-20 do
script.Parent.Position = UDim2.new(0,i,script.Parent.Position.Y.Scale,script.Parent.Position.Y.Offset)
wait()
end
script.Parent.Position = UDim2.new(0,-script.Parent.AbsoluteSize.x,script.Parent.Position.Y.Scale,script.Parent.Position.Y.Offset)
col.Text = ">>"
for i = 1,0,-0.1 do
col.TextTransparency = i
wait()
end
col.TextTransparency = 0
cur = -1
else
cur = 0
delay(0,function()
for i = 46,0,-4 do
col.Position = UDim2.new(1,i,0,-6)
col.TextTransparency = (1-(i/46))
wait()
end
col.Position = UDim2.new(1,0,0,-6)
col.TextTransparency = 1
end)
for i = -script.Parent.AbsoluteSize.x,10,20 do
script.Parent.Position = UDim2.new(0,i,script.Parent.Position.Y.Scale,script.Parent.Position.Y.Offset)
wait()
end
script.Parent.Position = UDim2.new(0,10,script.Parent.Position.Y.Scale,script.Parent.Position.Y.Offset)
col.Text = "<<"
for i = 1,0,-0.1 do
col.TextTransparency = i
wait()
end
col.TextTransparency = 0
cur = 1
end
end)
volume.Current.MouseButton1Down:connect(function(x) drag = true setCur(x) end)
volume.Current.MouseButton1Up:connect(function() drag = false end)
volume.Current.MouseMoved:connect(function(x) setCur(x) end)
volume.MouseArea.MouseMoved:connect(function(x) setCur(x) end)
volume.MouseArea.MouseLeave:connect(function() drag = false end)
end

getSongs()
setup()
Report Abuse
CitreIthkarr is not online. CitreIthkarr
Joined: 09 Jan 2014
Total Posts: 454
23 Mar 2014 04:46 PM
no thanks
Report Abuse
secretidagent is not online. secretidagent
Joined: 07 Nov 2010
Total Posts: 1600
23 Mar 2014 04:47 PM
Suggestion:

http://www.roblox.com/Forum/ShowPost.aspx?PostID=80625843
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