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 » Scripters
Home Search
 

Can someone help condense my script?

Previous Thread :: Next Thread 
Sharvarkie is not online. Sharvarkie
Joined: 20 May 2008
Total Posts: 279
11 Jul 2015 01:15 PM
--it's really unnecessarily long (so im told by a few scripters) and I hope to learn a few new things along the way

while game.ContentProvider.RequestQueueSize > 0 do wait() end
--if not game.Players.LocalPlayer.Character:WaitForChild("Humanoid") then return false end
--repeat wait() until game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

--*************************
local player = script.Parent.Parent

rf = game.ReplicatedFirst
rs = game.ReplicatedStorage
vc = game.Workspace.Views
--***************************

function AddLeaderboard()

local s = Instance.new("IntValue")
s.Name = "leaderstats"

local c = Instance.new("IntValue")
c.Name = "Spending Cash"
c.Value = 0
c.Parent = s

s.Parent = player

end

function DisplayCamera()
game.Workspace.CurrentCamera.CameraSubject = vc.V1
game.Workspace.CurrentCamera.CameraType = "Scriptable"
game.workspace.Camera.CoordinateFrame = vc.V1.CFrame
player.CameraMaxZoomDistance=25
end

function PlayGui()
local a = rf.EnterGui:Clone()
a.Parent = player.PlayerGui
wait(1)
a.Frame.TextLabel.TextTransparency=0.9
wait(.1)
a.Frame.TextLabel.TextTransparency=0.8
wait(.1)
a.Frame.TextLabel.TextTransparency=0.7
wait(.1)
a.Frame.TextLabel.TextTransparency=0.6
wait(.1)
a.Frame.TextLabel.TextTransparency=0.5
wait(.1)
a.Frame.TextLabel.TextTransparency=0.4
wait(.1)
a.Frame.TextLabel.TextTransparency=0.3
wait(.1)
a.Frame.TextLabel.TextTransparency=0.2
wait(.1)
a.Frame.TextLabel.TextTransparency=0.1
wait(.1)
a.Frame.TextLabel.TextTransparency=0.0
wait(4)
a.Frame.TextLabel.TextTransparency=0.1
wait(.1)
a.Frame.TextLabel.TextTransparency=0.2
wait(.1)
a.Frame.TextLabel.TextTransparency=0.3
wait(.1)
a.Frame.TextLabel.TextTransparency=0.4
wait(.1)
a.Frame.TextLabel.TextTransparency=0.5
wait(.1)
a.Frame.TextLabel.TextTransparency=0.6
wait(.1)
a.Frame.TextLabel.TextTransparency=0.7
wait(.1)
a.Frame.TextLabel.TextTransparency=0.8
wait(.1)
a.Frame.TextLabel.TextTransparency=0.9
wait(.1)
a.Frame.TextLabel.TextTransparency=1
wait(4)
a.Logo_ImageLabel.ImageTransparency=0.9
wait(.1)
a.Logo_ImageLabel.ImageTransparency=0.8
wait(.1)
a.Logo_ImageLabel.ImageTransparency=0.7
wait(.1)
a.Logo_ImageLabel.ImageTransparency=0.6
wait(.1)
a.Logo_ImageLabel.ImageTransparency=0.5
wait(.1)
a.Logo_ImageLabel.ImageTransparency=0.4
wait(.1)
a.Logo_ImageLabel.ImageTransparency=0.3
wait(.1)
a.Logo_ImageLabel.ImageTransparency=0.2
wait(.1)
a.Logo_ImageLabel.ImageTransparency=0.1
wait(.1)
a.Logo_ImageLabel.ImageTransparency=0
wait(4)
a.Frame.BackgroundTransparency=0.1
wait(.1)
a.Frame.BackgroundTransparency=0.2
wait(.1)
a.Frame.BackgroundTransparency=0.3
wait(.1)
a.Frame.BackgroundTransparency=0.4
wait(.1)
a.Frame.BackgroundTransparency=0.5
wait(.1)
a.Frame.BackgroundTransparency=0.6
wait(.1)
a.Frame.BackgroundTransparency=0.7
wait(.1)
a.Frame.BackgroundTransparency=0.8
wait(.1)
a.Frame.BackgroundTransparency=0.9
wait(.1)
a.Frame.BackgroundTransparency=1
wait(4)
end


function PlaySound()
local a = rs.Theme:Clone()
a.Parent=game.Workspace.CurrentCamera
a:Play()
end

PlaySound()
DisplayCamera()
PlayGui()
Report Abuse
ThaneTheCreator is not online. ThaneTheCreator
Joined: 08 Apr 2009
Total Posts: 2182
11 Jul 2015 01:34 PM
So unnecessarily long...

It's all those " a.Frame.TextLabel.TextTransparency" Just use a few for loops.

Use this:


while game.ContentProvider.RequestQueueSize > 0 do wait() end
--if not game.Players.LocalPlayer.Character:WaitForChild("Humanoid") then return false end
--repeat wait() until game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

--*************************
local player = script.Parent.Parent

rf = game.ReplicatedFirst
rs = game.ReplicatedStorage
vc = game.Workspace.Views
--***************************

function AddLeaderboard()

local s = Instance.new("IntValue")
s.Name = "leaderstats"

local c = Instance.new("IntValue")
c.Name = "Spending Cash"
c.Value = 0
c.Parent = s

s.Parent = player

end

function DisplayCamera()
game.Workspace.CurrentCamera.CameraSubject = vc.V1
game.Workspace.CurrentCamera.CameraType = "Scriptable"
game.workspace.Camera.CoordinateFrame = vc.V1.CFrame
player.CameraMaxZoomDistance=25
end

function PlayGui()
local a = rf.EnterGui:Clone()
a.Parent = player.PlayerGui
wait(0.9)
for a = 1,0,-0.1 do
a.Logo_ImageLabel.ImageTransparency=a
end
wait(4)
for a = 1,0,-0.1 do
a.Logo_ImageLabel.ImageTransparency=a
end
wait(4)
for a = 0,1,0.1 do
a.Logo_ImageLabel.ImageTransparency=a
end
wait(4)
end


function PlaySound()
local a = rs.Theme:Clone()
a.Parent=game.Workspace.CurrentCamera
a:Play()
end

PlaySound()
DisplayCamera()
PlayGui()
Report Abuse
Sharvarkie is not online. Sharvarkie
Joined: 20 May 2008
Total Posts: 279
12 Jul 2015 03:01 PM
That would be nice if it worked the way I wanted to lol
Report Abuse
Sharvarkie is not online. Sharvarkie
Joined: 20 May 2008
Total Posts: 279
12 Jul 2015 03:03 PM
ill fix it tho, no biggie
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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