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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 2921 |
|
|
| 04 Sep 2011 04:10 PM |
| Ok then, I'll try this out now. |
|
|
| Report Abuse |
|
|
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 |
|
|