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: Need help again!

Previous Thread :: Next Thread 
StrikerBOY606 is not online. StrikerBOY606
Joined: 25 Oct 2010
Total Posts: 747
22 Apr 2013 06:39 AM
This works in solo mode but not in online mode... When the player joins it will put a model inside their camera so only they can see it but it only works in solo mode...

game.Players.PlayerAdded:connect(function(player)
repeat wait() until game.Workspace:FindFirstChild("Camera")
game.Lighting.Starter:clone().Parent = game.Workspace.CurrentCamera
end)

for _, player in pairs(game.Players:GetPlayers()) do PlayerAdded(player) end
Report Abuse
StrikerBOY606 is not online. StrikerBOY606
Joined: 25 Oct 2010
Total Posts: 747
22 Apr 2013 06:40 AM
I've tried a LocalScript and that does not work but only works in a script.
Report Abuse
Voxility is not online. Voxility
Joined: 15 Apr 2013
Total Posts: 584
22 Apr 2013 06:58 AM
First of all you cannot use CurrentCamera alone in the script and you cannot use playeradded in localscripts, so yea, ALOT of Flaws, you cannot fix.
Report Abuse
StrikerBOY606 is not online. StrikerBOY606
Joined: 25 Oct 2010
Total Posts: 747
22 Apr 2013 07:03 AM
Sooooooo what would I use/do?
Report Abuse
Voxility is not online. Voxility
Joined: 15 Apr 2013
Total Posts: 584
22 Apr 2013 07:04 AM
Try to do it yourself ok?
Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
22 Apr 2013 07:10 AM
You could use coroutines and remove the player added event...
Report Abuse
StrikerBOY606 is not online. StrikerBOY606
Joined: 25 Oct 2010
Total Posts: 747
22 Apr 2013 07:11 AM
If I insert a script then put this in the script:

game.Players.PlayerAdded:connect(function(player)
repeat wait() until game.Workspace:FindFirstChild("Camera")
end)

for _, player in pairs(game.Players:GetPlayers()) do PlayerAdded(player) end

then put a LocalScript inside the script with this:

game.Lighting.Starter:clone().Parent = game.Workspace.CurrentCamera

???
Report Abuse
StrikerBOY606 is not online. StrikerBOY606
Joined: 25 Oct 2010
Total Posts: 747
22 Apr 2013 07:12 AM
How would I make it call the LocalScript when the PlayerAdded is fired?
Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
22 Apr 2013 07:12 AM
.____. No just no.
Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
22 Apr 2013 07:13 AM
Do you even know how a local script works?
Report Abuse
Voxility is not online. Voxility
Joined: 15 Apr 2013
Total Posts: 584
22 Apr 2013 07:15 AM
^ You are stating the wrong thing he should be doing.
Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
22 Apr 2013 07:17 AM
? The wrong thing is that he is using a Player added event in a local script. Not to mention he needs to index current camera.
Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
22 Apr 2013 07:18 AM
He needs to go back to the basics as I think he just skipped to camera manipulation.
Report Abuse
StrikerBOY606 is not online. StrikerBOY606
Joined: 25 Oct 2010
Total Posts: 747
22 Apr 2013 07:23 AM
I know the basics but I'm figuring out a new way to do it.
Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
22 Apr 2013 07:28 AM
..... Okay here is what you need to know:

1. You do not use Player Added in a local script. They run automatically for the player every time he joins/spawns.

2. You can not use this in a regular script.

3. Do this and come back with the output.
Report Abuse
StrikerBOY606 is not online. StrikerBOY606
Joined: 25 Oct 2010
Total Posts: 747
22 Apr 2013 07:34 AM
Ok, I removed the PlayerAdded function and put it in a LocalScript... (If that's what I'm meant to do)

repeat wait() until game.Workspace:FindFirstChild("Camera")
game.Lighting.Starter:clone().Parent = game.Workspace.CurrentCamera

Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
22 Apr 2013 08:01 AM
Did you put the local script in player Gui?
Report Abuse
StrikerBOY606 is not online. StrikerBOY606
Joined: 25 Oct 2010
Total Posts: 747
22 Apr 2013 08:10 AM
No, I will and I think I know how, I will come back if I fail!
Report Abuse
StrikerBOY606 is not online. StrikerBOY606
Joined: 25 Oct 2010
Total Posts: 747
22 Apr 2013 08:15 AM
Did it! Thanks btw!
Report Abuse
gamert7 is not online. gamert7
Joined: 18 Nov 2008
Total Posts: 4986
22 Apr 2013 08:24 AM
No problem.
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