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

Previous Thread :: Next Thread 
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
07 Oct 2013 07:47 PM
How do I make a script that detects when a player sits in a certain seat. I want the camera to be fixed on an invisible part (through a security camera ). I know the script is local but how do I connect the function?
Report Abuse
bballer13sn is not online. bballer13sn
Joined: 03 Jun 2009
Total Posts: 2490
07 Oct 2013 07:49 PM
http://wiki.roblox.com/index.php/Seated_(Event)
Report Abuse
Jetta765214 is not online. Jetta765214
Joined: 22 Oct 2008
Total Posts: 1855
07 Oct 2013 07:50 PM
to check if they sit in a seat, just do:

seat = game.Workspace.Seat
seat.ChildAdded:connect(function(part)
if part.ClassName == "Weld" then
character = part.Part1.Parent
player = game.Players:GetPlayerFromCharacter(character)

or something like that
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
07 Oct 2013 07:51 PM
Still, how do I define and change the camera's position?
Report Abuse
bballer13sn is not online. bballer13sn
Joined: 03 Jun 2009
Total Posts: 2490
07 Oct 2013 07:52 PM
game.Workspace.CurrentCamera.CoordinateFrame = Path.To.Security.Camera.Brick.CFrame
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
07 Oct 2013 07:56 PM
game.Workspace.Player.Humanoid.Seated:connect(function()
game.Workspace.CurrentCamera.CoordinateFrame = Game.workspace.Bob.CFrame
end)
doesn't work
Report Abuse
bballer13sn is not online. bballer13sn
Joined: 03 Jun 2009
Total Posts: 2490
07 Oct 2013 08:01 PM
Woah woah woah no.

Try this:

plr = game.Players.LocalPlayer
chr = nil

plr.CharacterAdded:connect(function(character)
chr = character
chr.Humanoid.Seated:connect(function()
game.Workspace.CurrentCamera.CoordinateFrame = game.workspace.Bob.CFrame
end)
end)

Make sure to put that in a LocalScript! I'm not certain on this, but I think the LocalScript should be directly in Workspace...
Report Abuse
king4000000 is not online. king4000000
Joined: 22 Oct 2011
Total Posts: 397
07 Oct 2013 08:17 PM
Nope doesn't work
Report Abuse
bballer13sn is not online. bballer13sn
Joined: 03 Jun 2009
Total Posts: 2490
07 Oct 2013 08:23 PM
Try just putting the CFrame values directly into that main line?
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