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 » Roblox » All Things ROBLOX
Home Search
 

Re: do you believe in magic

Previous Thread :: Next Thread 
bloxxyz is not online. bloxxyz
Joined: 15 Apr 2012
Total Posts: 6995
29 Dec 2014 03:10 AM
function ScreenSpaceToWorld(x, y, depth)
local resolution = self.AbsoluteSize
local aspectRatio = resolution.X / resolution.Y
local hfactor = math.tan(math.rad(c.FieldOfView)/2)
local wfactor = aspectRatio*hfactor
local xf, yf = x/resolution.X*2 - 1, y/resolution.Y*2 - 1
local xpos = xf * -wfactor * depth
local ypos = yf * hfactor * depth
return Vector3.new(xpos, ypos, depth)
end

function GetDepthForWidth(partWidth, visibleSize)
local resolution = self.AbsoluteSize;
local aspectRatio = resolution.X / resolution.Y
local hfactor = math.tan(math.rad(c.FieldOfView)/2)
local wfactor = aspectRatio*hfactor
return (-0.5*resolution.X*partWidth/(visibleSize*wfactor))
end
Report Abuse
Digitov is not online. Digitov
Joined: 26 Mar 2013
Total Posts: 10867
29 Dec 2014 03:12 AM
>incompleted
Report Abuse
bloxxyz is not online. bloxxyz
Joined: 15 Apr 2012
Total Posts: 6995
29 Dec 2014 03:13 AM
@Digitov

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Setup
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

self = script.Parent
c = workspace.CurrentCamera
rs = game:GetService("RunService")
util = LoadLibrary("RbxUtility")
Create = util.Create;
fade = self:WaitForChild("Fade")
music = self:WaitForChild("Music")

music:Stop()
music:Play()

game.StarterGui:SetCoreGuiEnabled("PlayerList",false)
game.StarterGui:SetCoreGuiEnabled("Health",false)
game.StarterGui:SetCoreGuiEnabled("Backpack",false)

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Screen Utilities

function ScreenSpaceToWorld(x, y, depth)
local resolution = self.AbsoluteSize
local aspectRatio = resolution.X / resolution.Y
local hfactor = math.tan(math.rad(c.FieldOfView)/2)
local wfactor = aspectRatio*hfactor
local xf, yf = x/resolution.X*2 - 1, y/resolution.Y*2 - 1
local xpos = xf * -wfactor * depth
local ypos = yf * hfactor * depth
return Vector3.new(xpos, ypos, depth)
end

function GetDepthForWidth(partWidth, visibleSize)
local resolution = self.AbsoluteSize;
local aspectRatio = resolution.X / resolution.Y
local hfactor = math.tan(math.rad(c.FieldOfView)/2)
local wfactor = aspectRatio*hfactor
return (-0.5*resolution.X*partWidth/(visibleSize*wfactor))
end

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Build inferno

for i = 0,1,.1 do
local p = Create'Part'
{ Name = "Fire";
Transparency = 1;
CanCollide = false;
Anchored = true;
Parent = c;
Create'Fire'
{
Size = 10;
Heat = 10;
}
}
local function update()
local res = self.AbsoluteSize
local x,y = (res.X*i), (res.Y*1.4)
local pos = ScreenSpaceToWorld(x,y,5)
p.CFrame = c.CoordinateFrame * CFrame.new(-pos);
end
update()
rs.RenderStepped:connect(update)
end

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Build backdrop

local backdrop = Create'Part'
{
FormFactor = "Custom";
Anchored = true;
CanCollide = false;
TopSurface = "Smooth";
BottomSurface = "Smooth";
Material = "WoodPlanks";
BrickColor = BrickColor.new("Reddish brown");
Parent = c;
}


function updateBackdrop()
local x,y = self.AbsoluteSize.X,self.AbsoluteSize.Y
local cx,cy = math.floor(x/2),math.floor(y/2)
local cz = GetDepthForWidth(40,x)
local ratio = y/x
local pos = ScreenSpaceToWorld(cx,cy,cz)
backdrop.Size = Vector3.new(40,40*ratio,0)
backdrop.CFrame = c.CoordinateFrame * CFrame.new(pos)
c.CameraType = "Scriptable"
c.CoordinateFrame = CFrame.new(9999,9999,9999);
end

updateBackdrop()
rs.RenderStepped:connect(updateBackdrop)

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Initial Fade-In

for i = 0,3.5,0.033907753944397 do
fade.BackgroundTransparency = i / 4
wait(0.033907753944397)
end

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Animation.

local word = "developer drama rocks"

while wait(.1) do
local name = ""
for char in word:gmatch(".") do
if math.random()>.5 then
name = name .. string.upper(char)
else
name = name .. string.lower(char)
end
end
local l = Create'TextLabel'
{
Size = UDim2.new();
BackgroundTransparency = 1;
Font = "SourceSansBold";
FontSize = "Size48";
TextColor3 = Color3.new(0,1,1);
TextStrokeTransparency = 0;
Position = UDim2.new(math.random(),0,-0.3,0);
Text = name;
Parent = self
}
local con = rs.RenderStepped:connect(function ()
local resY = self.AbsoluteSize.Y
local y = l.AbsolutePosition.Y
local alpha = ((resY-y)/resY)
local fade= 1 - (alpha * 3)
l.TextTransparency = fade
l.TextStrokeTransparency = fade
l.TextColor3 = Color3.new(1-alpha,alpha,alpha)

end)
l:TweenPosition(UDim2.new(math.random(),0,1.3,0),"Out","Linear",10,true,function ()
con:disconnect()
end)
game:GetService("Debris"):AddItem(l,10)
end

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Report Abuse
Digitov is not online. Digitov
Joined: 26 Mar 2013
Total Posts: 10867
29 Dec 2014 03:13 AM
ok dats better.
Report Abuse
Jayronstrikes123 is not online. Jayronstrikes123
Joined: 20 Jan 2014
Total Posts: 1067
29 Dec 2014 03:21 AM
yes


Hotdogs > Bacon
Report Abuse
DanBossStar321 is not online. DanBossStar321
Joined: 26 Dec 2012
Total Posts: 27652
29 Dec 2014 03:21 AM
yes

Indian of ATR | Follow me on Twitter (@DanBossStar321_)
Report Abuse
awesometinyman is not online. awesometinyman
Joined: 19 Mar 2011
Total Posts: 30
29 Dec 2014 03:26 AM
Such magic :O
Report Abuse
TiltingBooks is not online. TiltingBooks
Joined: 13 Dec 2014
Total Posts: 618
29 Dec 2014 03:32 AM
Wizard much?
Report Abuse
zeldu22 is not online. zeldu22
Joined: 22 Feb 2014
Total Posts: 5759
29 Dec 2014 03:34 AM
do i?.
Report Abuse
IDontHaveAUse is online. IDontHaveAUse
Joined: 20 Aug 2013
Total Posts: 7358
29 Dec 2014 03:36 AM
Its just a script tho
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Roblox » All Things ROBLOX
   
 
   
  • 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