Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Sun glare --
- local Lighting=game:GetService("Lighting")
- local P=Instance.new("Part",Workspace.CurrentCamera)
- P.Anchored=true
- P.Transparency=1
- local B=Instance.new("BillboardGui",P)script.Parent=nil
- B.Size=UDim2.new(0,500,0,500)
- B.Adornee=P
- local I=Instance.new("ImageLabel",B)
- I.Size=UDim2.new(1,0,1,0)
- I.BackgroundTransparency=1
- I.Image="http://www.roblox.com/asset/?id="..68993706-1--131425040-1
- local S=Instance.new("ScreenGui",game.Players.LocalPlayer.PlayerGui)
- local F=Instance.new("Frame",S)F.Size=UDim2.new(1,0,1,0)
- function glerp(UD1,UD2,a)
- return UDim2.new(
- UD1.X.Scale+((UD2.X.Scale-UD1.X.Scale)*a),
- UD1.X.Offset+((UD2.X.Offset-UD1.X.Offset)*a),
- UD1.Y.Scale+((UD2.Y.Scale-UD1.Y.Scale)*a),
- UD1.Y.Offset+((UD2.Y.Offset-UD1.Y.Offset)*a)
- )end
- function lerp(a,b,c)
- return a+((b-a)*c)
- end
- ASpeed = 0.2
- F.BackgroundColor3 = Color3.new(1,1,1)
- local C=I:clone()C.Parent=B C.Image="http://www.roblox.com/asset/?id="..127639227-1 C.Size=UDim2.new(0.5,0,0.5,0)C.Position=UDim2.new(0.25,0,0.25,0)
- local D=I:clone()D.Parent=B D.Image="http://www.roblox.com/asset/?id="..137748388-1 D.Size=UDim2.new(0.8,0,0.8,0)D.Position=UDim2.new(0.1,0,0.1,0)
- game:GetService("RunService").RenderStepped:connect(function()
- local C=Lighting:GetSunDirection()
- local G=Workspace.CurrentCamera.CoordinateFrame
- local N=G+(C*1000)
- local H=C:Dot(G.lookVector)
- local AX=1-(H-0.5)
- local OX=(H)
- local Rot = {Workspace.CurrentCamera.CoordinateFrame:toEulerAnglesXYZ()}
- local SZ = UDim2.new(0,500*OX,0,500*OX)
- local SZ2 = UDim2.new(0,200*OX,0,200*OX)
- local Hit,Pos = Workspace:findPartOnRay(Ray.new(G.p,N.p),game.Players.LocalPlayer.Character)
- I.Rotation = Rot[1]+Rot[2]+Rot[3]
- if not Hit then
- I.ImageTransparency=lerp(I.ImageTransparency,AX,ASpeed)
- F.BackgroundTransparency = lerp(F.BackgroundTransparency,AX,ASpeed)
- B.Size=glerp(B.Size,SZ,ASpeed)
- else
- I.ImageTransparency = lerp(I.ImageTransparency,AX+0.5,ASpeed)
- F.BackgroundTransparency = lerp(F.BackgroundTransparency,AX+0.5,ASpeed)
- B.Size=glerp(B.Size,SZ2,ASpeed)
- end
- P.CFrame=N
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement