|
| 24 Mar 2013 07:26 AM |
| So in order for them to work, you must make a local script in a descendant of the player to access their camera into the model and control them from there? Should I use GetChildren for this? |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 07:32 AM |
| Wow, people look but don't answer. |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 07:34 AM |
| You could just put a simple local script in the startergui and have them all do the same thing, and boom does the exact same thing, and it's easier. |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 07:35 AM |
| Explain that in detail please? I don't get what you said. |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 07:38 AM |
| Okay, when a player enters a game anything in there starter pack, and starter gui get cloned, depending on were you put it is were it ends up starter pack ends up in the player backpack, and starter gui ends up in the players gui. Well you said you needed to put a local script in a descendent of the player to access there camera, if you put the localscript into the starter gui you can clone a local script accessing there camera into the players gui. |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 07:41 AM |
| Scripts don't run in the camera. |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 07:43 AM |
Sorry, I am obviously not explaining good enough for you to understand what I am trying to get you to grasp, I will dumb this down as much as possible.
Put the script in the starter gui, then it will get cloned into every players PlayerGui when they enter, then code the local script to get the players camera and do whatever you wanted to do with it. |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 07:53 AM |
| Oh. That's what I basically said in the post. :L |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 07:55 AM |
Well, theirs obviously ways through scripts to do this, you could make the local script to access the players camera, and make it disabled, then use a normal script like this.
derp = game.Workspace.YourCameraLocalScript game.Players.PlayerAdded:connect(function(p) derp2 = derp:Clone() derp2.Parent = WhateverDescendantOfThePlayerYouWant end) |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 07:58 AM |
| I'm talking about NPCs, not players. Sorry if I said players in my posts. |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 07:58 AM |
But why won't this work?:
local cam = workspace.CurrentCamera
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) char:WaitForChild("Torso") char.Parent = cam end) end) |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 08:00 AM |
Change:
local cam = workspace.CurrentCamera
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) repeat wait() until (char ~= nil) char.Parent = cam end) end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Mar 2013 08:04 AM |
Examine the below LocalScript code:
repeat wait() until game.Players.LocalPlayer player = game.Players.LocalPlayer camera = game.Workspace.CurrentCamera
newClone = game.Lighting.NPC:Clone() -- You can access lighting locally, lol. newClone.Parent = camera -- Do what you want with the NPC. |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 24 Mar 2013 08:05 AM |
@Directory, I guess he already know how to do that.
But Mirror, please explain more in-depth. Should the NPCs be synchronized so they will all act the same, or should Player1 ex. see an NPC in a shop, while that NPC is on the roof of the shop on Player2's screen?
Because then we're going to have some kind of connection element in the Workspace or such, like a Humanoid in a Configuration :P Whenever it changes, the humanoid associated with that 'fake' Humanoid will do the same (except having 0 health xD).
So yeah, then you can manipulate local NPCs in that way.
Workspace >Camera for Player1 >>NPC1 >>NPC2 >Camera for Player2 >>NPC1 >HumanoidFolder (Configuration) >>NPC1 (Humanoid) <-- look, the humanoid have the same name as the NPC. >HumanoidManagement (Script)
Players >Player1 >>PlayerGui >>>MyHumanoidManager (Script) >Player2 >>PlayerGui >>>MyHumanoidManager (Script
Doesn't it seem good? yirh!
- As, their cat was sitting right there! |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Mar 2013 08:10 AM |
| Now I can make a single player RPG that's multiplayer, but single player! YEAH! |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 08:11 AM |
A problem with your script the destroyer: It clones the NPC when I respawn. |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 08:13 AM |
| Just create a value in the player that has to be false for my code to run... |
|
|
| Report Abuse |
|
|
|
| 24 Mar 2013 08:23 AM |
This would work?:
repeat wait() until game.Players.LocalPlayer player = game.Players.LocalPlayer NPCs = game.Lighting:GetChildren() bool = true camera = game.Workspace.CurrentCamera
for i = 1, #NPCs do if (bool == true) then bool = false newClone = NPCs[i]:Clone() newClone.Parent = camera else print("Don't Clone The NPC.") end end
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 24 Mar 2013 09:11 AM |
| Use a BoolValue. Everytime your script gets cloned the Bool is set to true again. |
|
|
| Report Abuse |
|
|
As8D
|
  |
| Joined: 24 Dec 2009 |
| Total Posts: 2907 |
|
|
| 24 Mar 2013 09:29 AM |
^ Or check whatever the camera already contain something.
if #workspace.CurrentCamera:GetChildren() > 0 then print("Oh no, we have already inserted something into the camera!") end
- As, font style mai ziggi pl0x. |
|
|
| Report Abuse |
|
|