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: Script not working?

Previous Thread :: Next Thread 
ColdUndermined is not online. ColdUndermined
Joined: 25 Jan 2010
Total Posts: 1819
27 Mar 2015 08:07 PM
Hey, so I have the script below inside my MainScript. Its suppose to return the cam to the player when called in.. It works fine in solo, but not in "Test" or online? any ideas? Thanks, Cold

function returnCam()
local players = game.Players:GetPlayers()

for i,v in pairs(players)do
game.Workspace.CurrentCamera.CameraSubject = v.Character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom"
game.Workspace.CurrentCamera.FieldOfView = 70
end
end
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
27 Mar 2015 08:22 PM
the "i,v" can't be done unless its in a table because 'i' doesn't exist, but v does, but you need the 'i' there, and make it a LocalScript, and I stings woulnt get the player, so a smarter thing to do would be this: (ill put the script thing Below)
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
27 Mar 2015 08:24 PM
function returnCam()
for _, Player in pairs (game.Players:GetPlayers()) do
if Player.Name = game.Players.LocalPlayer.Name then
game.Workspace.CurrentCamera.CameraSubject = v.Character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom"
game.Workspace.CurrentCamera.FieldOfView = 70
end
end
end --This should work, btw make it a LOCALSCRIPT not a server-sides one!
Report Abuse
ColdUndermined is not online. ColdUndermined
Joined: 25 Jan 2010
Total Posts: 1819
27 Mar 2015 08:26 PM
How can I get the script to activate though? (Keep in mind the game is with Filtering-Enabled)
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
27 Mar 2015 08:27 PM
Activate? its a function you just do returnCam(), even if the cam's subject is the Players it would still work...so you could do the function at any time
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
27 Mar 2015 08:28 PM
btw whats filther enabling?
Report Abuse
ColdUndermined is not online. ColdUndermined
Joined: 25 Jan 2010
Total Posts: 1819
27 Mar 2015 08:31 PM
What I mean, is how can I call it in with the MainScript
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
27 Mar 2015 08:34 PM
err.. my best answer to that is: the server script when you need the cam to be returned you make the server-sided make the localscript activated, but I don't see the reason why you would need that... because local scripts can interact with the server almost alot like a serve-sided one... so why need that? (or remote functions, remote events, I havn't learned those...yet)
Report Abuse
ColdUndermined is not online. ColdUndermined
Joined: 25 Jan 2010
Total Posts: 1819
27 Mar 2015 08:36 PM
I might make it clone and un-disable a script then delete it once the function is done.
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
27 Mar 2015 08:44 PM
there you go.. I didnt even have to give you a full idea.. :/
Report Abuse
ColdUndermined is not online. ColdUndermined
Joined: 25 Jan 2010
Total Posts: 1819
27 Mar 2015 08:46 PM
Idk lol.. I had no idea it had to be local but oh well :P
Report Abuse
TheScripterGeek is not online. TheScripterGeek
Joined: 02 Sep 2012
Total Posts: 1192
27 Mar 2015 08:49 PM
"I had no idea it had to be local.".... ;-;.. at least I told you about the for loops ;-;
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