|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 27 Mar 2015 08:28 PM |
| btw whats filther enabling? |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 08:31 PM |
| What I mean, is how can I call it in with the MainScript |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 27 Mar 2015 08:44 PM |
| there you go.. I didnt even have to give you a full idea.. :/ |
|
|
| Report Abuse |
|
|
|
| 27 Mar 2015 08:46 PM |
| Idk lol.. I had no idea it had to be local but oh well :P |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|