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: PlayerAdded: Anonymous Function not starting

Previous Thread :: Next Thread 
NewbControl114 is not online. NewbControl114
Joined: 09 May 2009
Total Posts: 10303
20 Oct 2013 02:48 PM
This script is supposed to lock a player's camera to track a brick in the 'Scriptable' mode when a player enters, and make the GUI visible. Basically, I'm trying to write my own Entrance GUI.

    print("Loaded")
    game.Players.PlayerAdded:connect(function(player)
        print("PlayerAdded")
        if player.TeamColor == BrickColor.new("Medium stone grey") then
            print("Player is Choosing")
            game.StarterGui.StartGUI.Frame.Visible = true
            print("GUI is Visible")
            game.Workspace.CurrentCamera.CameraSubject = game.Workspace.CameraBrick
            print("Camera assigned to CameraBrick")
            game.Workspace.CurrentCamera.CameraType = Scriptable
            print("CameraType Locked")
        else
            print("Player assigned to a team!")
        end
    end)

The output does not have any errors, and the only printed line is "Loaded", so there's an issue in calling the anonymous function.

I'm not smart, could someone point out my error(s) to me?


Report Abuse
Kondou is not online. Kondou
Joined: 05 Aug 2012
Total Posts: 1148
20 Oct 2013 02:50 PM
Can't use PlayerAdded in Solo, only works online.
Report Abuse
NewbControl114 is not online. NewbControl114
Joined: 09 May 2009
Total Posts: 10303
20 Oct 2013 02:51 PM
Okay. Thanks.
Report Abuse
NewbControl114 is not online. NewbControl114
Joined: 09 May 2009
Total Posts: 10303
20 Oct 2013 02:53 PM
It's still not doing anything when I play the game.
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
20 Oct 2013 02:59 PM
@Newb,
1) That's because you're changing the GUI which is in 'StarterGui', instead of the one which the player has (in their 'PlayerGui').
2) You cannot edit the players 'Camera' from a serverside script in the way you have.
3) game.Workspace.CurrentCamera.CameraType = Scriptable ---> game.Workspace.CurrentCamera.CameraType = "Scriptable "
Report Abuse
NewbControl114 is not online. NewbControl114
Joined: 09 May 2009
Total Posts: 10303
20 Oct 2013 03:02 PM
1) Alright
2) This is in a LocalScript
3) Thanks!
Report Abuse
NewbControl114 is not online. NewbControl114
Joined: 09 May 2009
Total Posts: 10303
20 Oct 2013 03:12 PM
'Tis still stopping at "Loaded".

Can I use in a LocalScript?
"game.Players.PlayerAdded:connect(function(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