|
| 21 Apr 2012 11:59 AM |
| Does LocalPlayer just check for the player that just entered? |
|
|
| Report Abuse |
|
|
|
| 21 Apr 2012 12:02 PM |
More importantly:
function onPlayerEntered() game.Players.LocalPlayer.CameraMode = LockFirstPerson end game.Players.PlayerAdded:connect(onPlayerEntered)
Why does this not work? |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 21 Apr 2012 12:02 PM |
| LocalPlayer is the (current) contiainer of a localScript. |
|
|
| Report Abuse |
|
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 21 Apr 2012 12:02 PM |
You mean PlayerAdded?
And to use that, you'd do:
game.Players.PlayerAdded:connect(function(player) player:Destroy() end)
It fires whenever a player is added to Players, and does something, or if you define the player who just entered near the function you can edit it.
http://wiki.roblox.com/index.php/PlayerAdded
|
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 21 Apr 2012 12:03 PM |
>game.Players.LocalPlayer.CameraMode = LockFirstPerson
workspace.CurrentCamera.CameraMode = "LockFirstPerson" |
|
|
| Report Abuse |
|
|
|
| 21 Apr 2012 12:03 PM |
I want to know how to define them.
I'm using a Global script for my LocalPlayer editing. |
|
|
| Report Abuse |
|
|
|
| 21 Apr 2012 12:04 PM |
| CameraMode is a property of PLayer... Workspace doesn't have a Camera property... |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 21 Apr 2012 12:06 PM |
local _G.LocalPlayers ={} table.insert(_G.LocalPlayers, game:GetService("Players").LocalPlayer)
I use a table in _G, 'cause that's easier. |
|
|
| Report Abuse |
|
|
|
| 21 Apr 2012 12:08 PM |
I don't understand code like that...
e.e |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
| |
|
|
| 21 Apr 2012 12:51 PM |
| You can only access any form of Camera through LocalScripts(As far as I know e.e), so what you would have to do is have the normal script run the .PlayerAdded event which clones a LocalScript, that has the code to change the camera, into the Player. |
|
|
| Report Abuse |
|
|