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
 

Re: Camera script not working in server?

Previous Thread :: Next Thread 
yeox769 is not online. yeox769
Joined: 21 Jun 2010
Total Posts: 8907
27 Sep 2015 09:55 PM
It works perfectly in Studio, but not in an actual server. It ends up in a weird direction.

I tried putting it in a LocalScript, I tried using WaitForChild, everything I could think of, and it still wouldn't work.

Here's the script:

wait(.1)

local cam = workspace.CurrentCamera

local setPosition = workspace.Part.Position --or do Vector3.new()
local lookPosition = workspace.Part2.Position --or do Vector3.new()

cam.CameraType = "Scriptable"
cam.CoordinateFrame = CFrame.new(lookPosition,setPosition)


did i win
Report Abuse
yeox769 is not online. yeox769
Joined: 21 Jun 2010
Total Posts: 8907
27 Sep 2015 10:06 PM
Can someone help?


did i win
Report Abuse
sporkyz is not online. sporkyz
Joined: 04 Apr 2010
Total Posts: 68
27 Sep 2015 10:09 PM
The reason why it isn't working in the server is because you are not getting the player's camera but the global camera which screws everything up. Well that is what I think is wrong anyways.
Report Abuse
yeox769 is not online. yeox769
Joined: 21 Jun 2010
Total Posts: 8907
27 Sep 2015 10:24 PM
How do I fix it?

I'm not that experienced at scripting tbh.


did i win
Report Abuse
Raphael7 is not online. Raphael7
Joined: 03 Dec 2008
Total Posts: 2479
27 Sep 2015 11:12 PM
You need a LocalScript for this and parented within the player, and you don't need a wait unless you're waiting for something to load.
Report Abuse
yeox769 is not online. yeox769
Joined: 21 Jun 2010
Total Posts: 8907
28 Sep 2015 05:09 PM
@Raph

It's already in a LocalScript, and it still doesn't work.


did i win
Report Abuse
yeox769 is not online. yeox769
Joined: 21 Jun 2010
Total Posts: 8907
28 Sep 2015 06:30 PM
Bump.


did i win
Report Abuse
Zakusa is not online. Zakusa
Joined: 16 Feb 2013
Total Posts: 359
28 Sep 2015 06:32 PM
you dont need a local script you need a script because i dont see the word localplayer anywhere in that
Report Abuse
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
28 Sep 2015 06:33 PM
^above learn to script before you answer questions.


I'm assuming you're just trying to prematurely access the camera. Try:


repeat wait() until game.Players.LocalPlayer.Character ~= nil


Netflix and chill? I prefer Blockbuster and relax.
Report Abuse
yeox769 is not online. yeox769
Joined: 21 Jun 2010
Total Posts: 8907
28 Sep 2015 06:34 PM
@Zak

I tried putting it in a regular script, and now it just doesn't work at all.

No errors or anything.


did i win
Report Abuse
yeox769 is not online. yeox769
Joined: 21 Jun 2010
Total Posts: 8907
28 Sep 2015 06:40 PM
@Ill

I tried that. It gives off an error. It won't let me post it here, so here you go:

http://pastebin.com/MtuF5BMK


did i win
Report Abuse
Eston is not online. Eston
Joined: 13 May 2008
Total Posts: 21591
28 Sep 2015 06:41 PM
No, no, no. I had the same question at one point, and these guys don't understand. If you want to have your script work as soon as a player enters, put your LocalScript into ReplicatedFirst. Also, use these
cam.CameraType = 0 -- fixed camera
cam.CoordinateFrame=CFrame.new(x, y, z) -- position of camera in 3d space
cam.FieldOfView=70
cam.Focus=CFrame.new(x, y, z) -- where camera focuses
Report Abuse
yeox769 is not online. yeox769
Joined: 21 Jun 2010
Total Posts: 8907
28 Sep 2015 06:47 PM
Thanks, Est!


did i win
Report Abuse
Eston is not online. Eston
Joined: 13 May 2008
Total Posts: 21591
28 Sep 2015 06:49 PM
no problem
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