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: For onPlayerEntered

Previous Thread :: Next Thread 
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
21 Apr 2012 11:59 AM
Does LocalPlayer just check for the player that just entered?
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
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 is not online. 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 is not online. 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 is not online. 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
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
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
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
21 Apr 2012 12:04 PM
CameraMode is a property of PLayer... Workspace doesn't have a Camera property...
Report Abuse
TheMyrco is not online. 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
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
21 Apr 2012 12:08 PM
I don't understand code like that...

e.e
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
21 Apr 2012 12:48 PM
It's like very basic x.x
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
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
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