OldGoldie
|
  |
| Joined: 17 Aug 2010 |
| Total Posts: 8210 |
|
|
| 04 Oct 2013 02:51 AM |
local char = game.Players.LocalPlayer.Character
while wait() do if char:FindFirstChild("Fake Head") then Workspace.CurrentCamera.CoordinateFrame = char["Fake Head"].CFrame.X - 10 end end
It's in a local script in startergui No output |
|
|
| Report Abuse |
|
|
BLOXLUA
|
  |
| Joined: 16 Mar 2013 |
| Total Posts: 453 |
|
|
| 04 Oct 2013 07:27 AM |
| Always put an "else" or an "elseif" in a conditional statement, just in case. |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2013 07:42 AM |
Scripts do not run in the StartGui.
If you are running this in the PlayerGui, try this.
--
local char = game.Players.LocalPlayer.Character
while wait() do if char:FindFirstChild("Fake Head") then Workspace.CurrentCamera.CoordinateFrame = char["Fake Head"].CFrame.X - 10 else print ("Fake Head is nil") end end
--If the output prints "Fake Head is nil", this means your if statement is false, thus why you were reading no output to begin with. |
|
|
| Report Abuse |
|
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 04 Oct 2013 07:46 AM |
@Killer If it's in the StarterGui it will automatically go to players' PlayerGui.
Also, I think this line
Workspace.CurrentCamera.CoordinateFrame = char["Fake Head"].CFrame.X - 10
is wrong, because you set the CoordinateFrame to only one number instead of 3. |
|
|
| Report Abuse |
|
|
|
| 04 Oct 2013 07:53 AM |
Though you are correct, if that were the issue, and output would have printed. You pointing this out has proven that the if statement is false, therefore "Fake Head" is infact nil, or does not exist.
Workspace.CurrentCamera.CoordinateFrame = char["Fake Head"].CFrame.X - 10
Should be..
Workspace.CurrentCamera.CoordinateFrame = char["Fake Head"].CFrame - Vector3.new (10, 0, 0) |
|
|
| Report Abuse |
|
|