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 with a camera script.

Previous Thread :: Next Thread 
Xsitsu is online. Xsitsu
Joined: 28 Jul 2009
Total Posts: 2921
04 Sep 2011 04:04 PM
So, in Script Builder I use this script here to nil my character and get a free roaming camera:

game.Players.Xsitsu.Character = nil


Then with another script I try using this to focus on another player and then kill that player to make myself respawn. I've seen some guy do it before, maybe not this exact way I'm trying it and it works for him.

What this does is it just kills the player, nothing else, can you help me see what's wrong and fix this for me?

--== No output! ==--
--== This is in a local script! ==--

local players = game.Players:GetChildren()

local player = math.floor(math.random(1, #players))

game.Workspace.CurrentCamera.CameraSubject = players[player].Character.Humanoid

players[player].Character:BreakJoints()
Report Abuse
Harrokin is not online. Harrokin
Joined: 10 Sep 2008
Total Posts: 8564
04 Sep 2011 04:06 PM
Having your camera focus on someone else doesn't mean you have their character.
You want to use the .Character property of your player, and set that to the other player. You'll then take over that player...at least partly.
Kill them, and then you will respawn.
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
04 Sep 2011 04:07 PM
game.Players.Xsitsu.Character=game.Players[target_name].Character;
game.Players.Xsitsu.Character:BreakJoints();
Report Abuse
Harrokin is not online. Harrokin
Joined: 10 Sep 2008
Total Posts: 8564
04 Sep 2011 04:09 PM
Heh, SDuke has the script you want; for the explanation see my post.
Report Abuse
Xsitsu is online. Xsitsu
Joined: 28 Jul 2009
Total Posts: 2921
04 Sep 2011 04:09 PM
I've tried that before and didn't work, so I thought that you needed to do stuff with the camera.

What would be the correct way of doing this. I've tried:

game.Players.Xsitsu.Character = game.Players.Persons.Character
game.Players.Xsitsu.Character = "Person"

Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
04 Sep 2011 04:10 PM
Your first way is correct, you probably just misspelled something when you tried it.
Report Abuse
Xsitsu is online. Xsitsu
Joined: 28 Jul 2009
Total Posts: 2921
04 Sep 2011 04:10 PM
Ok then, I'll try this out now.
Report Abuse
Harrokin is not online. Harrokin
Joined: 10 Sep 2008
Total Posts: 8564
04 Sep 2011 04:11 PM
Of course if you feel really awesome you could make a script which literally generates a new you.
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