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: RAIG

Previous Thread :: Next Thread 
deathrider2099 is not online. deathrider2099
Joined: 25 Feb 2010
Total Posts: 1322
05 Jun 2013 12:54 AM


w = game.Workspace
Camera = w.CurrentCamera
CameraMovement = {w.Cam,w.Part}
HasUsed = {false,false} --Add a false for every button
CameraPosition = {}
PartEnding = {} --Focus peak
Debounce = false

function CreatePart(StartingPoint)
part = Instance.new("Part",game.Workspace)
part.FormFactor = "Symmetric"
part.Size = Vector3.new(1,1,1)
part.Anchored = true
part.CFrame = StartingPoint
part.CanCollide = false
part.Transparency = 1
return part
end

function FreezeCharacter(boolean)
for i,v in pairs(game.Players.LocalPlayer.Character:GetChildren()) do
if v:IsA("Part") then
v.Anchored = boolean
elseif v:IsA("Humanoid") then
if boolean == true then
v.WalkSpeed = 0
else
v.WalkSpeed = 16
end
end
end
end

for CameraPositionIndex,TouchedPart in pairs(CameraMovement) do
TouchedPart.Touched:connect(function(hit)
if game.Players:FindFirstChild(hit.Parent.Name) and script.Parent.Parent == game.Players:FindFirstChild(hit.Parent.Name) and Debounce == false and HasUsed[CameraPositionIndex] == false then
HasUsed[CameraPositionIndex] = true
Debounce = true
FreezeCharacter(true)
Part = CreatePart(Camera.Focus)
--Camera.CameraType = "Attach"
Camera.CameraSubject = Part

StartingPos = Vector3.new(Camera.CoordinateFrame.x,Camera.CoordinateFrame.y,Camera.CoordinateFrame.z)
StartingFoc = Vector3.new(Part.CFrame.x,Part.CFrame.y,Part.CFrame.z)

for alpha = 0,1,0.01 do
Camera.CoordinateFrame = CFrame.new(StartingPos:Lerp(CameraPosition[CameraPositionIndex],alpha))
Part.CFrame = CFrame.new(StartingFoc:Lerp(PartEnding[CameraPositionIndex],alpha))
wait()
end

wait(2)

for alpha = 0,1,0.01 do
Camera.CoordinateFrame = CFrame.new(CameraPosition[CameraPositionIndex]:Lerp(StartingPos,alpha))
Part.CFrame = CFrame.new(PartEnding[CameraPositionIndex]:Lerp(StartingFoc,alpha))
wait()
end

Camera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
--Camera.CameraType = "Custom"
Part:Destroy()
FreezeCharacter(false)
wait(0.5)
Debounce = false
end
end)
end

HOW DO I MOVE CAMERA TO THE DESIRED LOCATION!!!!!!!!
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
05 Jun 2013 12:58 AM
Please post the output you got from running this script if any. If anything, tell us what the script does and where you think the mess up is.
Report Abuse
deathrider2099 is not online. deathrider2099
Joined: 25 Feb 2010
Total Posts: 1322
05 Jun 2013 01:00 AM
Never Mind I got it figured out....
Report Abuse
yomomma128 is not online. yomomma128
Joined: 13 Nov 2008
Total Posts: 23503
05 Jun 2013 01:27 AM
Friend
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